<html>
<head><meta charset="utf-8"><title>binder refactor · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html">binder refactor</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229671001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229671001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229671001">(Mar 10 2021 at 14:39)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> let me know when you're available</p>



<a name="229675332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229675332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229675332">(Mar 10 2021 at 15:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ping</p>



<a name="229675577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229675577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229675577">(Mar 10 2021 at 15:03)</a>:</h4>
<p>Just waiting on Niko <span aria-label="rolling eyes" class="emoji emoji-1f644" role="img" title="rolling eyes">:rolling_eyes:</span></p>



<a name="229675884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229675884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229675884">(Mar 10 2021 at 15:05)</a>:</h4>
<p>Oh <span class="user-mention" data-user-id="116009">@nikomatsakis</span> is active now :)</p>



<a name="229676003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676003">(Mar 10 2021 at 15:05)</a>:</h4>
<p>wave</p>



<a name="229676052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676052">(Mar 10 2021 at 15:06)</a>:</h4>
<p>Zoom? or text?</p>



<a name="229676125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676125">(Mar 10 2021 at 15:06)</a>:</h4>
<p>hmm</p>



<a name="229676150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676150">(Mar 10 2021 at 15:06)</a>:</h4>
<p>I'm kind of rather text if that's ok</p>



<a name="229676175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676175">(Mar 10 2021 at 15:06)</a>:</h4>
<p>Works for me</p>



<a name="229676266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676266">(Mar 10 2021 at 15:07)</a>:</h4>
<p>Changed the topic here</p>



<a name="229676270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676270">(Mar 10 2021 at 15:07)</a>:</h4>
<p>I'm looking backwards briefly to remember where we are at</p>



<a name="229676346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676346">(Mar 10 2021 at 15:07)</a>:</h4>
<p>ok</p>



<a name="229676358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676358">(Mar 10 2021 at 15:07)</a>:</h4>
<p>I sort of remember now :)</p>



<a name="229676433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676433">(Mar 10 2021 at 15:08)</a>:</h4>
<p>I can talk through anything that you feel might be helpful. And/or I can discuss the recent progress that I made and the next challenge</p>



<a name="229676651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676651">(Mar 10 2021 at 15:09)</a>:</h4>
<p>well</p>



<a name="229676796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676796">(Mar 10 2021 at 15:10)</a>:</h4>
<p>you mentioned that you  had solved some things</p>



<a name="229676800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676800">(Mar 10 2021 at 15:10)</a>:</h4>
<p>:)</p>



<a name="229676806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676806">(Mar 10 2021 at 15:10)</a>:</h4>
<p>so I am torn between forcing you to repeat</p>



<a name="229676841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676841">(Mar 10 2021 at 15:10)</a>:</h4>
<p>or just having you talk about the challenge</p>



<a name="229676863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676863">(Mar 10 2021 at 15:10)</a>:</h4>
<p>I guess let me run some thoughts by you to see if I'm following</p>



<a name="229676904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676904">(Mar 10 2021 at 15:10)</a>:</h4>
<p>ah I remember that I wanted to talk a bit about how the <code>Foo&lt;T: Bar&gt;</code> desugaring works</p>



<a name="229676909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676909">(Mar 10 2021 at 15:10)</a>:</h4>
<p>Yes, of course</p>



<a name="229676924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229676924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229676924">(Mar 10 2021 at 15:11)</a>:</h4>
<p>I can talk through that</p>



<a name="229677038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677038">(Mar 10 2021 at 15:11)</a>:</h4>
<p>that sounds helpful</p>



<a name="229677083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677083">(Mar 10 2021 at 15:11)</a>:</h4>
<p>Ok, so let's see</p>



<a name="229677099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677099">(Mar 10 2021 at 15:11)</a>:</h4>
<p>to start, how is <code>Foo&lt;T: Bar&gt;</code> represented in HIR?</p>



<a name="229677207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677207">(Mar 10 2021 at 15:12)</a>:</h4>
<p>Well, let's go with <code>T: Foo&lt;T: Bar&gt;</code></p>



<a name="229677256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677256">(Mar 10 2021 at 15:12)</a>:</h4>
<p>I recommend <code>T: Foo&lt;Bar: Baz&gt;</code> or something</p>



<a name="229677261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677261">(Mar 10 2021 at 15:12)</a>:</h4>
<p>not to repeat <code>T</code> :)</p>



<a name="229677275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677275">(Mar 10 2021 at 15:12)</a>:</h4>
<p>oops yeah</p>



<a name="229677282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677282">(Mar 10 2021 at 15:12)</a>:</h4>
<p>but yes</p>



<a name="229677311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677311">(Mar 10 2021 at 15:12)</a>:</h4>
<p>that is a <code>hir::TraitRef</code></p>



<a name="229677341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677341">(Mar 10 2021 at 15:12)</a>:</h4>
<p>(I'm also trying to find code snippets)</p>



<a name="229677482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677482">(Mar 10 2021 at 15:13)</a>:</h4>
<p>but maybe: <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.TraitRef.html">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.TraitRef.html</a></p>



<a name="229677509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677509">(Mar 10 2021 at 15:13)</a>:</h4>
<p>I just loaded that :)</p>



<a name="229677679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677679">(Mar 10 2021 at 15:14)</a>:</h4>
<p>so it's part of a <code>PathSegment</code>?</p>



<a name="229677694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677694">(Mar 10 2021 at 15:14)</a>:</h4>
<p>yes</p>



<a name="229677754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677754">(Mar 10 2021 at 15:14)</a>:</h4>
<p>I guess it's a <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.TypeBinding.html"><code>TypeBinding</code></a></p>



<a name="229677759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677759">(Mar 10 2021 at 15:14)</a>:</h4>
<p>since you could do <code>T: buzz::Foo&lt;Bar: Baz&gt;</code></p>



<a name="229677772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677772">(Mar 10 2021 at 15:14)</a>:</h4>
<p>Yes</p>



<a name="229677785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677785">(Mar 10 2021 at 15:14)</a>:</h4>
<p>OK</p>



<a name="229677804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677804">(Mar 10 2021 at 15:15)</a>:</h4>
<p>I feel like you'll click through things faster then I can type</p>



<a name="229677899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677899">(Mar 10 2021 at 15:15)</a>:</h4>
<p>So that means that AstConv is responsible for managing those</p>



<a name="229677908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677908">(Mar 10 2021 at 15:15)</a>:</h4>
<p>and converting them into predicates</p>



<a name="229677936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677936">(Mar 10 2021 at 15:15)</a>:</h4>
<p>(<span class="user-mention" data-user-id="116266">@Santiago Pastorino</span>, are you following along?)</p>



<a name="229677942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677942">(Mar 10 2021 at 15:15)</a>:</h4>
<p>yes</p>



<a name="229677946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677946">(Mar 10 2021 at 15:15)</a>:</h4>
<p>(or others?)</p>



<a name="229677950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229677950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229677950">(Mar 10 2021 at 15:15)</a>:</h4>
<p>I don't want to leave folks behind :)</p>



<a name="229678039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678039">(Mar 10 2021 at 15:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/a4d9624242df6bfe6c0a298867dd2bd527263424/compiler/rustc_typeck/src/astconv/mod.rs#L635"><code>instantiate_poly_trait_ref</code></a> is sort of the entrypoint for that</p>



<a name="229678172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678172">(Mar 10 2021 at 15:16)</a>:</h4>
<p>(side note, there is an awesome vscode plugin for getting canonical github links from active vscode editors)</p>



<a name="229678188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678188">(Mar 10 2021 at 15:16)</a>:</h4>
<p>ooh</p>



<a name="229678323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678323">(Mar 10 2021 at 15:17)</a>:</h4>
<p>There we essentially push <code>T: Foo</code>, then calls <code>add_predicates_for_ast_type_binding</code> for the <code>Bar: Baz</code> binding</p>



<a name="229678399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678399">(Mar 10 2021 at 15:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229678172">said</a>:</p>
<blockquote>
<p>(side note, there is an awesome vscode plugin for getting canonical github links from active vscode editors)</p>
</blockquote>
<p>This? <a href="https://marketplace.visualstudio.com/items?itemName=gimenete.github-linker">https://marketplace.visualstudio.com/items?itemName=gimenete.github-linker</a></p>



<a name="229678409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678409">(Mar 10 2021 at 15:18)</a>:</h4>
<p>so how related is that to the code that manages <code>Foo&lt;T = Bar&gt;</code></p>



<a name="229678534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678534">(Mar 10 2021 at 15:18)</a>:</h4>
<p>the one I use is called "copy-github-permalink"</p>



<a name="229678566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678566">(Mar 10 2021 at 15:18)</a>:</h4>
<p>Right, so add_predicates_for_ast_type_binding handles both <code>T: Bar</code> or <code>T = Bar</code></p>



<a name="229678568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678568">(Mar 10 2021 at 15:18)</a>:</h4>
<p><a href="https://marketplace.visualstudio.com/items?itemName=hogashi.vscode-copy-github-permalink">link</a></p>



<a name="229678578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678578">(Mar 10 2021 at 15:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229677936">said</a>:</p>
<blockquote>
<p>(<span class="user-mention silent" data-user-id="116266">Santiago Pastorino</span>, are you following along?)</p>
</blockquote>
<p>sorry, Julieta is a bit sick, back and catching up</p>



<a name="229678599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678599">(Mar 10 2021 at 15:18)</a>:</h4>
<p>ok, so this is related to what <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> was asking yesterday in a way</p>



<a name="229678607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678607">(Mar 10 2021 at 15:18)</a>:</h4>
<p>about where the upcasts happen</p>



<a name="229678617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678617">(Mar 10 2021 at 15:19)</a>:</h4>
<p>But it first changes <code>T: Foo</code> to <code>T: Buzz</code> if <code>Foo</code> doesn't actually define <code>Bar</code></p>



<a name="229678692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678692">(Mar 10 2021 at 15:19)</a>:</h4>
<p>yes :)</p>



<a name="229678712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678712">(Mar 10 2021 at 15:19)</a>:</h4>
<p>i.e., we start out with the trait-ref the user gave: <code>T: Foo</code> (or whatever)</p>



<a name="229678724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678724">(Mar 10 2021 at 15:19)</a>:</h4>
<p>then we enumerate all the upcast versions of it</p>



<a name="229678739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678739">(Mar 10 2021 at 15:19)</a>:</h4>
<p>(more or less)</p>



<a name="229678747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678747">(Mar 10 2021 at 15:19)</a>:</h4>
<p>and evaluate the bindings against those</p>



<a name="229678792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678792">(Mar 10 2021 at 15:19)</a>:</h4>
<p>looking for the one where the associated type appears directly in the trait</p>



<a name="229678809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678809">(Mar 10 2021 at 15:19)</a>:</h4>
<p>Yes</p>



<a name="229678901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678901">(Mar 10 2021 at 15:20)</a>:</h4>
<p>in what way are <code>AT: Foo</code> worse than <code>AT=X</code> bindings?</p>



<a name="229678998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229678998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229678998">(Mar 10 2021 at 15:20)</a>:</h4>
<p>Well, a few</p>



<a name="229679006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679006">(Mar 10 2021 at 15:20)</a>:</h4>
<p>before you answer that</p>



<a name="229679119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679119">(Mar 10 2021 at 15:21)</a>:</h4>
<p>/me waits</p>



<a name="229679130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679130">(Mar 10 2021 at 15:21)</a>:</h4>
<p>so <code>instantiate_poly_trait_ref_inner</code> <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L650-L656">invokes <code>create_substs_for_ast_trait_ref</code></a></p>



<a name="229679165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679165">(Mar 10 2021 at 15:21)</a>:</h4>
<p>Yes</p>



<a name="229679193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679193">(Mar 10 2021 at 15:21)</a>:</h4>
<p>which in turn invokes <code>create_substs_for_ast_path</code></p>



<a name="229679260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679260">(Mar 10 2021 at 15:22)</a>:</h4>
<p>This essentially just gets the substs for <code>Foo&lt;'a, T, U&gt;</code></p>



<a name="229679312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679312">(Mar 10 2021 at 15:22)</a>:</h4>
<p>It doesn't handle associated types</p>



<a name="229679381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679381">(Mar 10 2021 at 15:22)</a>:</h4>
<p>I have to get my noise cancelling headphoens</p>



<a name="229679403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679403">(Mar 10 2021 at 15:22)</a>:</h4>
<p>the neighbors have decided to use their jackhammers today</p>



<a name="229679415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679415">(Mar 10 2021 at 15:22)</a>:</h4>
<p>Well...</p>



<a name="229679426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679426">(Mar 10 2021 at 15:22)</a>:</h4>
<p>Actually it sort of does</p>



<a name="229679441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679441">(Mar 10 2021 at 15:22)</a>:</h4>
<p>But at the end of the function</p>



<a name="229679472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679472">(Mar 10 2021 at 15:22)</a>:</h4>
<p>In my branch, I actually split it out for clarity</p>



<a name="229679651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679651">(Mar 10 2021 at 15:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229679441">said</a>:</p>
<blockquote>
<p>But at the end of the function</p>
</blockquote>
<p>you mean <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L549-L577">this code</a>?</p>



<a name="229679659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679659">(Mar 10 2021 at 15:23)</a>:</h4>
<p>But that does lead to the first point to you "why is it worse question"</p>



<a name="229679690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679690">(Mar 10 2021 at 15:23)</a>:</h4>
<p>yeah</p>



<a name="229679728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679728">(Mar 10 2021 at 15:24)</a>:</h4>
<p>that's not at all dependent on the rest of the function</p>



<a name="229679851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679851">(Mar 10 2021 at 15:24)</a>:</h4>
<p>ok so</p>



<a name="229679866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679866">(Mar 10 2021 at 15:24)</a>:</h4>
<p>this actually doesn't do the upcasting</p>



<a name="229679900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679900">(Mar 10 2021 at 15:24)</a>:</h4>
<p>it just converts e.g. <code>Item = u32</code> into a <code>ConvertedBindingKind::Equality(u32)</code></p>



<a name="229679920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679920">(Mar 10 2021 at 15:24)</a>:</h4>
<p>right</p>



<a name="229679926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679926">(Mar 10 2021 at 15:25)</a>:</h4>
<p>(eagerly)</p>



<a name="229679965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679965">(Mar 10 2021 at 15:25)</a>:</h4>
<p>Whereas <code>Item: Bar</code> is lazy</p>



<a name="229679974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229679974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229679974">(Mar 10 2021 at 15:25)</a>:</h4>
<p>interesting</p>



<a name="229680004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680004">(Mar 10 2021 at 15:25)</a>:</h4>
<p>(first point)</p>



<a name="229680081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680081">(Mar 10 2021 at 15:25)</a>:</h4>
<p>upcasting is in <code>add_predicates_for_ast_type_binding</code></p>



<a name="229680091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680091">(Mar 10 2021 at 15:25)</a>:</h4>
<p>and yeah this is totally independent, isn't it?</p>



<a name="229680096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680096">(Mar 10 2021 at 15:25)</a>:</h4>
<p>ok</p>



<a name="229680288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680288">(Mar 10 2021 at 15:26)</a>:</h4>
<p><code>instantiate_poly_trait_ref</code> only pushes <code>T: Foo</code>, not <code>T: Bar</code> (where Bar would be upcasted)</p>



<a name="229680474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680474">(Mar 10 2021 at 15:27)</a>:</h4>
<p>wait what</p>



<a name="229680503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680503">(Mar 10 2021 at 15:27)</a>:</h4>
<p>ok ok I think I understand</p>



<a name="229680524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680524">(Mar 10 2021 at 15:27)</a>:</h4>
<p>Okay, the second point to why <code>As: Foo</code> is worse than <code>As = X</code> (ready?)</p>



<a name="229680543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680543">(Mar 10 2021 at 15:27)</a>:</h4>
<p>ok</p>



<a name="229680561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680561">(Mar 10 2021 at 15:27)</a>:</h4>
<p><code>As: Foo</code> allows new late bound vars</p>



<a name="229680592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680592">(Mar 10 2021 at 15:27)</a>:</h4>
<p>i.e. <code>As: for&lt;'b&gt; Foo&lt;'b&gt;</code></p>



<a name="229680708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680708">(Mar 10 2021 at 15:28)</a>:</h4>
<p>I'm trying to remember what we said about GATs and forall binders</p>



<a name="229680739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680739">(Mar 10 2021 at 15:28)</a>:</h4>
<p>and whether it made any sense to have <code>T: Foo&lt;for&lt;'a&gt; AT&lt;'a&gt; = ...&gt;</code></p>



<a name="229680755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680755">(Mar 10 2021 at 15:28)</a>:</h4>
<p>but ok</p>



<a name="229680806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680806">(Mar 10 2021 at 15:28)</a>:</h4>
<p>let's go back to the narration</p>



<a name="229680820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680820">(Mar 10 2021 at 15:28)</a>:</h4>
<p>So, for GATs, it would have to be <code>for&lt;'a&gt; Foo&lt;AT&lt;'a&gt; = ...&gt;</code></p>



<a name="229680934"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680934" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680934">(Mar 10 2021 at 15:29)</a>:</h4>
<p>Really, they ultimately end up being the same :)</p>



<a name="229680966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229680966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229680966">(Mar 10 2021 at 15:29)</a>:</h4>
<p>Okay, so continuing</p>



<a name="229681181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681181">(Mar 10 2021 at 15:30)</a>:</h4>
<p>So the <code>At: Foo</code> bit isn't actually just a PolyTraitRef, it's actually a list of <em>bounds</em></p>



<a name="229681215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681215">(Mar 10 2021 at 15:30)</a>:</h4>
<p>since you could also have <code>Outlives</code></p>



<a name="229681220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681220">(Mar 10 2021 at 15:30)</a>:</h4>
<p>so at <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L650-L657">this point</a> we have the (non-upcast) trait ref and a set of "converted" bindings</p>



<a name="229681317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681317">(Mar 10 2021 at 15:31)</a>:</h4>
<p>yes</p>



<a name="229681375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681375">(Mar 10 2021 at 15:31)</a>:</h4>
<p>then we <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L663-L672">invoke <code>add_predicates_for_ast_type_bindings</code></a></p>



<a name="229681385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681385">(Mar 10 2021 at 15:31)</a>:</h4>
<p>yes</p>



<a name="229681639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681639">(Mar 10 2021 at 15:32)</a>:</h4>
<p>Okay, I'll continue?</p>



<a name="229681695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681695">(Mar 10 2021 at 15:32)</a>:</h4>
<p>So, then, in <code>add_predicates_for_ast_type_bindings</code></p>



<a name="229681709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681709">(Mar 10 2021 at 15:32)</a>:</h4>
<p>sorry, reading into the code</p>



<a name="229681886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681886">(Mar 10 2021 at 15:33)</a>:</h4>
<p>We have to take our upcasted <code>T: Bar</code> and our associated type <code>As</code> (with optional substs on <code>As</code>), and make a projection ty <code>&lt;T as Bar&gt;::As</code></p>



<a name="229681974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229681974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229681974">(Mar 10 2021 at 15:33)</a>:</h4>
<p>the upcasting occurs in <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L999-L1010">the call to <code>one_bound_for_assoc_type</code></a>?</p>



<a name="229682007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682007">(Mar 10 2021 at 15:33)</a>:</h4>
<p>(again, I'm not sure how much help me typing things out versus you just reading code is)</p>



<a name="229682145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682145">(Mar 10 2021 at 15:34)</a>:</h4>
<p>yes</p>



<a name="229682169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682169">(Mar 10 2021 at 15:34)</a>:</h4>
<p>heh, probably better if you just let me ask you questions for a bit</p>



<a name="229682273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682273">(Mar 10 2021 at 15:34)</a>:</h4>
<p>that fn is essentially just a wrapper around <code>traits::supertraits</code></p>



<a name="229682404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682404">(Mar 10 2021 at 15:35)</a>:</h4>
<p>i.e. elaborating super traits to find all candidates of <code>As</code>, and then spitting diagnostics if there are multiple</p>



<a name="229682447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682447">(Mar 10 2021 at 15:35)</a>:</h4>
<p>right</p>



<a name="229682503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682503">(Mar 10 2021 at 15:35)</a>:</h4>
<p>ok, and that is called for both equality and the other kind</p>



<a name="229682511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682511">(Mar 10 2021 at 15:35)</a>:</h4>
<p>and it returns the upcast trait ref</p>



<a name="229682740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682740">(Mar 10 2021 at 15:36)</a>:</h4>
<p>Well, the important args there are <code>trait::supertraits(...)</code> and <code>binding.item_name</code></p>



<a name="229682785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682785">(Mar 10 2021 at 15:36)</a>:</h4>
<p>right</p>



<a name="229682786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682786">(Mar 10 2021 at 15:36)</a>:</h4>
<p>It doesn't really care about whether we have <code>Constraint</code> or <code>Equality</code> bounds</p>



<a name="229682799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682799">(Mar 10 2021 at 15:36)</a>:</h4>
<p>right</p>



<a name="229682924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682924">(Mar 10 2021 at 15:37)</a>:</h4>
<p>the next notable event is that we <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L1052-L1078">create the projection type</a></p>



<a name="229682950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682950">(Mar 10 2021 at 15:37)</a>:</h4>
<p>yep</p>



<a name="229682975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682975">(Mar 10 2021 at 15:37)</a>:</h4>
<p>and then <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L1117-L1146">do the actual binding conversion here</a></p>



<a name="229682977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229682977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229682977">(Mar 10 2021 at 15:37)</a>:</h4>
<p>ok</p>



<a name="229683041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683041">(Mar 10 2021 at 15:37)</a>:</h4>
<p>ok, thank you for your patience</p>



<a name="229683045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683045">(Mar 10 2021 at 15:37)</a>:</h4>
<p>yes</p>



<a name="229683055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683055">(Mar 10 2021 at 15:37)</a>:</h4>
<p>no problem :)</p>



<a name="229683058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683058">(Mar 10 2021 at 15:38)</a>:</h4>
<p>so binders</p>



<a name="229683151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683151">(Mar 10 2021 at 15:38)</a>:</h4>
<p>Right, binders</p>



<a name="229683225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683225">(Mar 10 2021 at 15:38)</a>:</h4>
<p>the challenge here is that the <code>AT: Foo</code> (or the <code>AT = Foo</code>, for that matter) occur under a different set of binders</p>



<a name="229683240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683240">(Mar 10 2021 at 15:38)</a>:</h4>
<p>and we didn't "take them through the upcast" somehow</p>



<a name="229683261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683261">(Mar 10 2021 at 15:38)</a>:</h4>
<p>Well...</p>



<a name="229683388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683388">(Mar 10 2021 at 15:39)</a>:</h4>
<p>I guess this doesn't apply to <code>AT = Foo</code> today .......... ? I'm a bit confused about that</p>



<a name="229683389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683389">(Mar 10 2021 at 15:39)</a>:</h4>
<p>So, for me, it's actually helpful to split <code>At: Foo</code> into the <code>At</code> bit and the <code>for&lt;...&gt; Foo</code> bit</p>



<a name="229683476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683476">(Mar 10 2021 at 15:39)</a>:</h4>
<p>The <code>At</code> bit has a set of binders that is defined by the trait ref of the trait that defines it</p>



<a name="229683540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683540">(Mar 10 2021 at 15:40)</a>:</h4>
<p>imagine you have <code>for&lt;'a&gt; T: Foo&lt;'a, AT = &amp;'a u32&gt;</code></p>



<a name="229683635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683635">(Mar 10 2021 at 15:40)</a>:</h4>
<p>hmm</p>



<a name="229683726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683726">(Mar 10 2021 at 15:41)</a>:</h4>
<p>and</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">type</span> <span class="nc">AT</span><span class="p">;</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="229683921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229683921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229683921">(Mar 10 2021 at 15:41)</a>:</h4>
<p>(also important to note that <code>one_bound_for_assoc_type</code> does <code>subst_supertrait</code>)</p>



<a name="229684059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684059">(Mar 10 2021 at 15:42)</a>:</h4>
<p>ok, so is the trick here that we preserve the indices</p>



<a name="229684073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684073">(Mar 10 2021 at 15:42)</a>:</h4>
<p>and because we flatten the binders</p>



<a name="229684081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684081">(Mar 10 2021 at 15:42)</a>:</h4>
<p>the depth still works?</p>



<a name="229684104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684104">(Mar 10 2021 at 15:42)</a>:</h4>
<p>i.e., the danger is that <code>AT = &amp;'a u32</code> existed under one level of binder</p>



<a name="229684154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684154">(Mar 10 2021 at 15:42)</a>:</h4>
<p>Well...depth is the tricky bit :) that I'd like to get to</p>



<a name="229684158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684158">(Mar 10 2021 at 15:42)</a>:</h4>
<p>but we now inserting it into <code>for&lt;'a, 'b&gt;</code></p>



<a name="229684271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684271">(Mar 10 2021 at 15:43)</a>:</h4>
<p>The problem with depth is <em>not</em> the supertrait bounds</p>



<a name="229684307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684307">(Mar 10 2021 at 15:43)</a>:</h4>
<p>Since the associated type contraints/equality can't name them</p>



<a name="229684329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684329">(Mar 10 2021 at 15:43)</a>:</h4>
<p>(they are only "seen" in the projection type)</p>



<a name="229684560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684560">(Mar 10 2021 at 15:44)</a>:</h4>
<p>seen/found</p>



<a name="229684596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684596">(Mar 10 2021 at 15:44)</a>:</h4>
<p>ok, what is the problem?</p>



<a name="229684658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684658">(Mar 10 2021 at 15:45)</a>:</h4>
<p>The problem with depth comes into play with the "constrained" lifetimes</p>



<a name="229684684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684684">(Mar 10 2021 at 15:45)</a>:</h4>
<p>let me type up an example</p>



<a name="229684689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684689">(Mar 10 2021 at 15:45)</a>:</h4>
<p>If I think about this in terms of recursive binders</p>



<a name="229684741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684741">(Mar 10 2021 at 15:45)</a>:</h4>
<p>it seems relatively easy but it requires a bit of "careful attention"</p>



<a name="229684785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684785">(Mar 10 2021 at 15:45)</a>:</h4>
<p>in particular, you would have to take <code>&amp;'a u32</code> and "push it through" the additional binders that were added to the trait ref by the upcasting</p>



<a name="229684862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684862">(Mar 10 2021 at 15:46)</a>:</h4>
<p><code>for&lt;'a&gt; T: Foo&lt;Bar: for&lt;'x&gt; Baz&lt;As: 'a + 'x&gt;</code></p>



<a name="229684960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684960">(Mar 10 2021 at 15:46)</a>:</h4>
<p>Here, <code>'a</code> is okay, but <code>'x</code> is not</p>



<a name="229684992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229684992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229684992">(Mar 10 2021 at 15:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229684658">said</a>:</p>
<blockquote>
<p>The problem with depth comes into play with the "constrained" lifetimes</p>
</blockquote>
<p>to be clear, you only have problems with <code>AT: ...</code></p>



<a name="229685023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685023">(Mar 10 2021 at 15:46)</a>:</h4>
<p>and not <code>AT = ...</code>?</p>



<a name="229685027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685027">(Mar 10 2021 at 15:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229684992">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229684658">said</a>:</p>
<blockquote>
<p>The problem with depth comes into play with the "constrained" lifetimes</p>
</blockquote>
<p>to be clear, you only have problems with <code>AT: ...</code></p>
</blockquote>
<p>yes :)</p>



<a name="229685068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685068">(Mar 10 2021 at 15:46)</a>:</h4>
<p>and my description of why <code>AT = X</code> works sounds right to you?</p>



<a name="229685087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685087">(Mar 10 2021 at 15:47)</a>:</h4>
<p>i.e., we add any new things to the end of the index list</p>



<a name="229685148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685148">(Mar 10 2021 at 15:47)</a>:</h4>
<p>and we don't introduce any new binders</p>



<a name="229685151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685151">(Mar 10 2021 at 15:47)</a>:</h4>
<p>(because we flatten)</p>



<a name="229685168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685168">(Mar 10 2021 at 15:47)</a>:</h4>
<p>so everything is preserved?</p>



<a name="229685202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685202">(Mar 10 2021 at 15:47)</a>:</h4>
<p>um, yes?</p>



<a name="229685207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685207">(Mar 10 2021 at 15:47)</a>:</h4>
<p>Yes</p>



<a name="229685232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685232">(Mar 10 2021 at 15:47)</a>:</h4>
<p>I think it makes sense :) this is what <code>subst_supertrait</code> does essentially</p>



<a name="229685274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685274">(Mar 10 2021 at 15:48)</a>:</h4>
<p>/me goes to get link</p>



<a name="229685360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685360">(Mar 10 2021 at 15:48)</a>:</h4>
<p>instead of taking <code>for&lt;'a&gt; T: Foo&lt;'a&gt;</code> and producing <code>for&lt;'a&gt; for&lt;'b&gt; T: Bar&lt;'a, 'b&gt;</code></p>



<a name="229685398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685398">(Mar 10 2021 at 15:48)</a>:</h4>
<p>it produces <code>for&lt;'a, 'b&gt; T: Bar&lt;'a, 'b&gt;</code></p>



<a name="229685436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685436">(Mar 10 2021 at 15:48)</a>:</h4>
<p><del>maybe that would be clearer if I quantified over <code>'a</code></del> done</p>



<a name="229685438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685438">(Mar 10 2021 at 15:48)</a>:</h4>
<p><a href="https://github.com/jackh726/rust/blob/2656d6f363f671df23bc1770d994332c4098c3d0/compiler/rustc_middle/src/ty/mod.rs#L1148">https://github.com/jackh726/rust/blob/2656d6f363f671df23bc1770d994332c4098c3d0/compiler/rustc_middle/src/ty/mod.rs#L1148</a></p>



<a name="229685559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685559">(Mar 10 2021 at 15:49)</a>:</h4>
<p>yes, I think you've got it</p>



<a name="229685575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685575">(Mar 10 2021 at 15:49)</a>:</h4>
<p>ok</p>



<a name="229685598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685598">(Mar 10 2021 at 15:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229684862">said</a>:</p>
<blockquote>
<p><code>for&lt;'a&gt; T: Foo&lt;Bar: for&lt;'x&gt; Baz&lt;As: 'a + 'x&gt;</code></p>
</blockquote>
<p>so let's go back to this</p>



<a name="229685611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685611">(Mar 10 2021 at 15:49)</a>:</h4>
<p>Right, so</p>



<a name="229685663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685663">(Mar 10 2021 at 15:50)</a>:</h4>
<p>Should I explain, or let you ask questions</p>



<a name="229685755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685755">(Mar 10 2021 at 15:50)</a>:</h4>
<p>why don't you narrate now</p>



<a name="229685768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685768">(Mar 10 2021 at 15:50)</a>:</h4>
<p>Okay</p>



<a name="229685779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685779">(Mar 10 2021 at 15:50)</a>:</h4>
<p>or I could dig through the code I guess</p>



<a name="229685785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685785">(Mar 10 2021 at 15:50)</a>:</h4>
<p>maybe that's better :)</p>



<a name="229685816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685816">(Mar 10 2021 at 15:50)</a>:</h4>
<p>you mean walk through the code that handles <code>As: 'a + 'x</code>?</p>



<a name="229685850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685850">(Mar 10 2021 at 15:50)</a>:</h4>
<p>Well, that's in <code>add_bounds</code></p>



<a name="229685875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685875">(Mar 10 2021 at 15:50)</a>:</h4>
<p><a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L1134-L1145">this call</a></p>



<a name="229685881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229685881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229685881">(Mar 10 2021 at 15:50)</a>:</h4>
<p>right</p>



<a name="229686019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686019">(Mar 10 2021 at 15:51)</a>:</h4>
<p>But this check actually gets called <a href="https://github.com/nikomatsakis/rust/blob/a118ee2c13cc96ceb27bd5030c1cca1052377604/compiler/rustc_typeck/src/astconv/mod.rs#L1088">here</a></p>



<a name="229686058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686058">(Mar 10 2021 at 15:51)</a>:</h4>
<p>err</p>



<a name="229686065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686065">(Mar 10 2021 at 15:51)</a>:</h4>
<p>Well</p>



<a name="229686091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686091">(Mar 10 2021 at 15:51)</a>:</h4>
<p>what check</p>



<a name="229686107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686107">(Mar 10 2021 at 15:51)</a>:</h4>
<p>let me make the example more simple</p>



<a name="229686291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686291">(Mar 10 2021 at 15:52)</a>:</h4>
<p><code>for&lt;'a&gt; T: Foo&lt;Bar: for&lt;'x&gt; Baz&lt;As = Buzz&lt;'a, 'x&gt;&gt;&gt;</code></p>



<a name="229686359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686359">(Mar 10 2021 at 15:52)</a>:</h4>
<p>This problem ends up not being directly related to the associated type bounds at all</p>



<a name="229686374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686374">(Mar 10 2021 at 15:52)</a>:</h4>
<p>but to <em>depth</em></p>



<a name="229686509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686509">(Mar 10 2021 at 15:53)</a>:</h4>
<p>Specifically, what we <em>want</em> to do (and what I've basically finished at this point, since yesterday)</p>



<a name="229686539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686539">(Mar 10 2021 at 15:53)</a>:</h4>
<p>Is to "flatten" all the late bound vars</p>



<a name="229686541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686541">(Mar 10 2021 at 15:53)</a>:</h4>
<p>oh, fun</p>



<a name="229686547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686547">(Mar 10 2021 at 15:53)</a>:</h4>
<p>ok</p>



<a name="229686721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686721">(Mar 10 2021 at 15:54)</a>:</h4>
<p>So for that inner <code>&lt;...&gt;::Bar: Baz&lt;As = Buzz&lt;'a, 'x&gt;&gt;</code> has late bound vars essentially like <code>for&lt;'a, 'x&gt;</code></p>



<a name="229686782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686782">(Mar 10 2021 at 15:54)</a>:</h4>
<p>The problem is the contrained lifetimes check</p>



<a name="229686863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686863">(Mar 10 2021 at 15:55)</a>:</h4>
<p>Before, <code>'a</code> is "escaping" that trait ref</p>



<a name="229686878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686878">(Mar 10 2021 at 15:55)</a>:</h4>
<p>But now it isn't</p>



<a name="229686987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229686987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229686987">(Mar 10 2021 at 15:55)</a>:</h4>
<p>I will pause</p>



<a name="229687035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687035">(Mar 10 2021 at 15:55)</a>:</h4>
<p>ok, yes. I'm wonering if we should plan some time to continue tomorrow or Friday :)</p>



<a name="229687059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687059">(Mar 10 2021 at 15:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229678534">said</a>:</p>
<blockquote>
<p>the one I use is called "copy-github-permalink"</p>
</blockquote>
<p><span aria-label="heart" class="emoji emoji-2764" role="img" title="heart">:heart:</span> that's really useful, thanks</p>



<a name="229687067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687067">(Mar 10 2021 at 15:55)</a>:</h4>
<p>I'm following so far :)</p>



<a name="229687084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687084">(Mar 10 2021 at 15:56)</a>:</h4>
<p>tomorrow would be better</p>



<a name="229687155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687155">(Mar 10 2021 at 15:56)</a>:</h4>
<p>ok</p>



<a name="229687192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687192">(Mar 10 2021 at 15:56)</a>:</h4>
<p>I'm still turning over what is the "right" way to do this</p>



<a name="229687220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687220">(Mar 10 2021 at 15:56)</a>:</h4>
<p>in general the managing of binders in astconv is a bit meh</p>



<a name="229687232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687232">(Mar 10 2021 at 15:56)</a>:</h4>
<p>But, to extend on this:</p>



<a name="229687266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687266">(Mar 10 2021 at 15:56)</a>:</h4>
<p>if I recall there's some subtle stuff where the code kind of "knows" that things are at a certain depth etc</p>



<a name="229687335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687335">(Mar 10 2021 at 15:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229687220">said</a>:</p>
<blockquote>
<p>in general the managing of binders in astconv is a bit meh</p>
</blockquote>
<p>Well, from yesterday, I don't manage binders there at all. It's all done in <code>late/lifetimes</code></p>



<a name="229687355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687355">(Mar 10 2021 at 15:57)</a>:</h4>
<p>I could prob chat at <time datetime="2021-03-11T14:00:00Z">2021-03-11T09:00:00-05:00</time> on Zulip</p>



<a name="229687400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687400">(Mar 10 2021 at 15:57)</a>:</h4>
<p>I can do then</p>



<a name="229687492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687492">(Mar 10 2021 at 15:57)</a>:</h4>
<p>I'm still turning over the idea of producing nested things and flatenning :)</p>



<a name="229687527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687527">(Mar 10 2021 at 15:57)</a>:</h4>
<p>but I'd like to know what this new approach of yours is, definitely</p>



<a name="229687677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687677">(Mar 10 2021 at 15:58)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229687232">said</a>:</p>
<blockquote>
<p>But, to extend on this:</p>
</blockquote>
<p>The way I've written the code currently is <em>all</em> late bound vars get concatenated. Including something like <code>fn foo&lt;'a, T&gt;() where for T: Bar&lt;As: 'a&gt;</code></p>



<a name="229687773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687773">(Mar 10 2021 at 15:58)</a>:</h4>
<p>The bound vars on that final predicate get to be <code>for&lt;'a&gt;</code></p>



<a name="229687808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687808">(Mar 10 2021 at 15:58)</a>:</h4>
<p>And so now they're not "escaping" and things fail</p>



<a name="229687900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687900">(Mar 10 2021 at 15:59)</a>:</h4>
<p>This, we could easily just say "okay we only flatten in trait refs", but then what about trait objects? etc. etc.</p>



<a name="229687939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229687939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229687939">(Mar 10 2021 at 15:59)</a>:</h4>
<p>A can of worms</p>



<a name="229688417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229688417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229688417">(Mar 10 2021 at 16:00)</a>:</h4>
<p>Surprisingly, there's a state where flattening the indices but keeping the depth as what it is in <code>hir/ast</code> works completely fine. Which says to me that at some point things are getting mangled</p>



<a name="229688789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229688789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229688789">(Mar 10 2021 at 16:01)</a>:</h4>
<p>Like, quite literally <code>https://github.com/rust-lang/rust/compare/master...jackh726:binder-refactor-ohno</code> builds completely fine and passes all the new tests</p>



<a name="229688839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229688839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229688839">(Mar 10 2021 at 16:01)</a>:</h4>
<p>well, all tests, including new ones</p>



<a name="229700516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229700516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229700516">(Mar 10 2021 at 16:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229687677">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229687232">said</a>:</p>
<blockquote>
<p>But, to extend on this:</p>
</blockquote>
<p>The way I've written the code currently is <em>all</em> late bound vars get concatenated. Including something like <code>fn foo&lt;'a, T&gt;() where for T: Bar&lt;As: 'a&gt;</code></p>
</blockquote>
<p>I've convinced myself that not allowing this is more correct; any impl of <code>Bar</code> would never be able to ensure that <code>As</code> outlives a lifetime it can't name</p>



<a name="229700674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229700674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229700674">(Mar 10 2021 at 16:51)</a>:</h4>
<p>And I think think that's the first user-visible semantic change</p>



<a name="229701440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229701440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229701440">(Mar 10 2021 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I also realized that I forgot I have a meeting tomorrow from 8:30 to 10:00-10:30 ish. If there's another time tomorrow that also works for you, that would be more ideal for me. But as long as we're just text chatting, I can be around at 9:00 and discuss. Just may have to go away at moments</p>



<a name="229702839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229702839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229702839">(Mar 10 2021 at 17:03)</a>:</h4>
<p>sorry that I needed to leave, already catched up with stuff, tomorrow I can also try to participate</p>



<a name="229731238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229731238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229731238">(Mar 10 2021 at 19:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229700516">said</a>:</p>
<blockquote>
<p>...<br>
I've convinced myself that not allowing this is more correct; any impl of <code>Bar</code> would never be able to ensure that <code>As</code> outlives a lifetime it can't name</p>
</blockquote>
<p>But wait, what about</p>
<div class="codehilite"><pre><span></span><code>fn b&lt;T&gt;(items: &amp;[T]) -&gt; Box&lt;dyn Iterator&lt;Item=&amp;T&gt; + &#39;_&gt; { ... }
</code></pre></div>
<p>Or put slightly differently:</p>
<div class="codehilite"><pre><span></span><code>fn b_2&lt;T&gt;(items: &amp;[T]) -&gt; Box&lt;std::slice::Iter&lt;&#39;_, T&gt;&gt; { ... }
</code></pre></div>
<p>I've unconvinced myself</p>



<a name="229851931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229851931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229851931">(Mar 11 2021 at 14:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> around?</p>



<a name="229851991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229851991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229851991">(Mar 11 2021 at 14:02)</a>:</h4>
<p>I'm around</p>



<a name="229852052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852052">(Mar 11 2021 at 14:02)</a>:</h4>
<p>for some reason I thought you were busy</p>



<a name="229852065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852065">(Mar 11 2021 at 14:02)</a>:</h4>
<p>oh, because you said you were</p>



<a name="229852080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852080">(Mar 11 2021 at 14:02)</a>:</h4>
<p>I'm on a call :)</p>



<a name="229852086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852086">(Mar 11 2021 at 14:02)</a>:</h4>
<p>But can chat</p>



<a name="229852186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852186">(Mar 11 2021 at 14:03)</a>:</h4>
<p>ok, I can also be around later potentially</p>



<a name="229852243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852243">(Mar 11 2021 at 14:03)</a>:</h4>
<p>it's the compiler team triage meeting but lately i've been leaving that to <span class="user-mention" data-user-id="116083">@pnkfelix</span> and just skimming later :P</p>



<a name="229852296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852296">(Mar 11 2021 at 14:03)</a>:</h4>
<p>I'm good to chat now</p>



<a name="229852311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852311">(Mar 11 2021 at 14:03)</a>:</h4>
<p>Not a problem</p>



<a name="229852375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852375">(Mar 11 2021 at 14:04)</a>:</h4>
<p>(don't tell anyone)</p>



<a name="229852387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852387">(Mar 11 2021 at 14:04)</a>:</h4>
<p>ok</p>



<a name="229852401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852401">(Mar 11 2021 at 14:04)</a>:</h4>
<p>Plus, I know you're around now, and wouldn't want to risk you being too busy later</p>



<a name="229852454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852454">(Mar 11 2021 at 14:04)</a>:</h4>
<p>Alright so</p>



<a name="229852501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852501">(Mar 11 2021 at 14:05)</a>:</h4>
<p>I'm trying to find a charger for my computer</p>



<a name="229852506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852506">(Mar 11 2021 at 14:05)</a>:</h4>
<p>Where do you want to start?</p>



<a name="229852890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229852890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229852890">(Mar 11 2021 at 14:07)</a>:</h4>
<p>let me see</p>



<a name="229853092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853092">(Mar 11 2021 at 14:08)</a>:</h4>
<p>let me scroll back a bit</p>



<a name="229853130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853130">(Mar 11 2021 at 14:08)</a>:</h4>
<p>Okay, that works for me</p>



<a name="229853938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853938">(Mar 11 2021 at 14:13)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> do you want me to start reading your branch?</p>



<a name="229853955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853955">(Mar 11 2021 at 14:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229688789">said</a>:</p>
<blockquote>
<p>Like, quite literally <code>https://github.com/rust-lang/rust/compare/master...jackh726:binder-refactor-ohno</code> builds completely fine and passes all the new tests</p>
</blockquote>
<p>like this one?</p>



<a name="229853964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853964">(Mar 11 2021 at 14:13)</a>:</h4>
<p>You could</p>



<a name="229853979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229853979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229853979">(Mar 11 2021 at 14:13)</a>:</h4>
<p>I could also summarize what I do</p>



<a name="229854000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854000">(Mar 11 2021 at 14:13)</a>:</h4>
<p>And the problems I've encountered</p>



<a name="229854127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854127">(Mar 11 2021 at 14:14)</a>:</h4>
<p>I'm also realizing just how underspecified associated type bounds are</p>



<a name="229854160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854160">(Mar 11 2021 at 14:14)</a>:</h4>
<p>say more?</p>



<a name="229854172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854172">(Mar 11 2021 at 14:14)</a>:</h4>
<p>when I run into issues like <a href="https://github.com/rust-lang/rust/issues/83017">#83017</a></p>



<a name="229854198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854198">(Mar 11 2021 at 14:14)</a>:</h4>
<p>or <a href="https://github.com/rust-lang/rust/issues/81193">#81193</a></p>



<a name="229854380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229854380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229854380">(Mar 11 2021 at 14:15)</a>:</h4>
<p>These are like, the same "idea" of the issues that I <em>have</em> to think about when being explicit about late bound vars</p>



<a name="229855487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855487">(Mar 11 2021 at 14:22)</a>:</h4>
<p>those are intense examples :)</p>



<a name="229855528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855528">(Mar 11 2021 at 14:22)</a>:</h4>
<p>I guess let me check out your branch</p>



<a name="229855565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855565">(Mar 11 2021 at 14:22)</a>:</h4>
<p>Sure</p>



<a name="229855602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855602">(Mar 11 2021 at 14:22)</a>:</h4>
<p>Let me know if you need a summary</p>



<a name="229855683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855683">(Mar 11 2021 at 14:22)</a>:</h4>
<p><code>late/lifetimes</code> and <code>astconv/mod</code> are the most relevant</p>



<a name="229855776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229855776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229855776">(Mar 11 2021 at 14:23)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/commit/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839">https://github.com/rust-lang/rust/commit/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839</a> is the big "shift" in approach</p>



<a name="229857004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229857004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229857004">(Mar 11 2021 at 14:30)</a>:</h4>
<p>checked out and building</p>



<a name="229857020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229857020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229857020">(Mar 11 2021 at 14:30)</a>:</h4>
<p>that's helpful</p>



<a name="229857035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229857035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229857035">(Mar 11 2021 at 14:30)</a>:</h4>
<p>it's probablya best if I read into the code and throw questions your way</p>



<a name="229857384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229857384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229857384">(Mar 11 2021 at 14:32)</a>:</h4>
<p>That works for me</p>



<a name="229857999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229857999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229857999">(Mar 11 2021 at 14:36)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I'm looking over stuff like <code>shifted_ast_region_to_region</code> and I'm wondering -- was that pre-existing?</p>



<a name="229858004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858004">(Mar 11 2021 at 14:36)</a>:</h4>
<p>or a fn you introduced</p>



<a name="229858021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858021">(Mar 11 2021 at 14:36)</a>:</h4>
<p>introduced</p>



<a name="229858039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858039">(Mar 11 2021 at 14:36)</a>:</h4>
<p>(and I hate it)</p>



<a name="229858145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858145">(Mar 11 2021 at 14:37)</a>:</h4>
<p>that is removed in the latest commits though, right?</p>



<a name="229858194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858194">(Mar 11 2021 at 14:37)</a>:</h4>
<p>I <em>was</em> using that to shift the vars based on newly introduced super trait vars</p>



<a name="229858198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858198">(Mar 11 2021 at 14:37)</a>:</h4>
<p>yes, I'm just trying to figure out what "essence" of this commit is :)</p>



<a name="229858482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858482">(Mar 11 2021 at 14:39)</a>:</h4>
<p>Yeah, so a key bit is here: <a href="https://github.com/rust-lang/rust/commit/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839#diff-87880ceb989914cb25dc43961cb1cee5e7b07d8b04bcd9c967e7995cd85315d9R2598">https://github.com/rust-lang/rust/commit/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839#diff-87880ceb989914cb25dc43961cb1cee5e7b07d8b04bcd9c967e7995cd85315d9R2598</a></p>



<a name="229858570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858570">(Mar 11 2021 at 14:39)</a>:</h4>
<p>Essentially, I can now know what supertrait HRTBs we need to keep around</p>



<a name="229858620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858620">(Mar 11 2021 at 14:39)</a>:</h4>
<p>and so I can late those into account in the late bound vars</p>



<a name="229858628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858628">(Mar 11 2021 at 14:40)</a>:</h4>
<p>that link didn't work for me</p>



<a name="229858680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858680">(Mar 11 2021 at 14:40)</a>:</h4>
<p>oops</p>



<a name="229858706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858706">(Mar 11 2021 at 14:40)</a>:</h4>
<p>I bet late/lifetimes isn't expanded</p>



<a name="229858738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858738">(Mar 11 2021 at 14:40)</a>:</h4>
<p>It's essentially where I introduce the <code>Supertrait</code> scope</p>



<a name="229858807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229858807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229858807">(Mar 11 2021 at 14:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229858620">said</a>:</p>
<blockquote>
<p>and so I can late those into account in the late bound vars</p>
</blockquote>
<p>And therefore don't have to worry about them in <code>astconv/mod</code>, since they are already accounted for</p>



<a name="229859060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859060">(Mar 11 2021 at 14:42)</a>:</h4>
<p>I think it'd be more helpful to give me links into the source</p>



<a name="229859143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859143">(Mar 11 2021 at 14:43)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839/compiler/rustc_resolve/src/late/lifetimes.rs#L2598">https://github.com/rust-lang/rust/blob/021ca0ffb2b181ac2c9ec4d7a159bb1fc8770839/compiler/rustc_resolve/src/late/lifetimes.rs#L2598</a></p>



<a name="229859155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859155">(Mar 11 2021 at 14:43)</a>:</h4>
<p>how's that</p>



<a name="229859235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859235">(Mar 11 2021 at 14:43)</a>:</h4>
<p>It's really not super helpful. Just all these changes are possible because of it</p>



<a name="229859462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859462">(Mar 11 2021 at 14:44)</a>:</h4>
<p>so you introduced the <code>Supertrait</code> scope?</p>



<a name="229859562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859562">(Mar 11 2021 at 14:45)</a>:</h4>
<p>yes</p>



<a name="229859623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859623">(Mar 11 2021 at 14:45)</a>:</h4>
<p>ok, I understand what it's going I <em>think</em></p>



<a name="229859756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859756">(Mar 11 2021 at 14:46)</a>:</h4>
<p>I have to dig a bit deeper but presumably</p>



<a name="229859819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859819">(Mar 11 2021 at 14:46)</a>:</h4>
<p>when you have <code>trait Foo: for&lt;'b&gt; Bar { .. }</code> and you're looking at some associated type <code>AT</code> defined in <code>Bar</code>, you introduce this <code>Supertrait</code> scope to account for the <code>for&lt;'b&gt;</code>?</p>



<a name="229859894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229859894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229859894">(Mar 11 2021 at 14:47)</a>:</h4>
<p>exactly</p>



<a name="229861307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861307">(Mar 11 2021 at 14:55)</a>:</h4>
<p>ok</p>



<a name="229861339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861339">(Mar 11 2021 at 14:55)</a>:</h4>
<p>I'm reading more into the code :)</p>



<a name="229861450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861450">(Mar 11 2021 at 14:55)</a>:</h4>
<p>I'm here for questions or whatever :)</p>



<a name="229861589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861589">(Mar 11 2021 at 14:56)</a>:</h4>
<p>I'm thinking about it</p>



<a name="229861609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861609">(Mar 11 2021 at 14:56)</a>:</h4>
<p>I'm not sure what time you have to go, but I would like to discuss the problems I've run into (if you haven't already figured it out)</p>



<a name="229861612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861612">(Mar 11 2021 at 14:56)</a>:</h4>
<p>I guess my question is</p>



<a name="229861627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861627">(Mar 11 2021 at 14:56)</a>:</h4>
<p>what goes wrong now?</p>



<a name="229861652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861652">(Mar 11 2021 at 14:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229861609">said</a>:</p>
<blockquote>
<p>I'm not sure what time you have to go, but I would like to discuss the problems I've run into (if you haven't already figured it out)</p>
</blockquote>
<p>yeah, this</p>



<a name="229861670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861670">(Mar 11 2021 at 14:56)</a>:</h4>
<p>that said, maybe we have to continue tomorrow :)</p>



<a name="229861709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861709">(Mar 11 2021 at 14:57)</a>:</h4>
<p>but it'd be good to get strated now</p>



<a name="229861716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861716">(Mar 11 2021 at 14:57)</a>:</h4>
<p>haha I can be available tomorrow morning again</p>



<a name="229861733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861733">(Mar 11 2021 at 14:57)</a>:</h4>
<p>But as far as I can tell, there are two problems</p>



<a name="229861788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861788">(Mar 11 2021 at 14:57)</a>:</h4>
<p>The first revolves around "constrained lifetimes" in trait refs/functions</p>



<a name="229861941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861941">(Mar 11 2021 at 14:58)</a>:</h4>
<p>i.e. <code>fn foo&lt;'a, T&gt;() where for T: Bar&lt;As = &amp;'a ()&gt;</code></p>



<a name="229861983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229861983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229861983">(Mar 11 2021 at 14:58)</a>:</h4>
<p>"early bound" lifetimes?</p>



<a name="229862017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862017">(Mar 11 2021 at 14:58)</a>:</h4>
<p>not quite</p>



<a name="229862023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862023">(Mar 11 2021 at 14:58)</a>:</h4>
<p>we probably use the term constrained in many different ways</p>



<a name="229862079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862079">(Mar 11 2021 at 14:59)</a>:</h4>
<p>ah, so the point is that they're targeted by the <code>As = ...</code> binding</p>



<a name="229862121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862121">(Mar 11 2021 at 14:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229861941">said</a>:</p>
<blockquote>
<p>i.e. <code>fn foo&lt;'a, T&gt;() where for T: Bar&lt;As = &amp;'a ()&gt;</code></p>
</blockquote>
<p>currently, this is okay, because <code>'a</code> is escaping the <code>T: ...</code> trait ref</p>



<a name="229862210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862210">(Mar 11 2021 at 15:00)</a>:</h4>
<p>what do you mean by "this is ok"</p>



<a name="229862288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862288">(Mar 11 2021 at 15:00)</a>:</h4>
<p>or maybe that will become clear as you continue</p>



<a name="229862291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862291">(Mar 11 2021 at 15:00)</a>:</h4>
<p>It compiles fine</p>



<a name="229862436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862436">(Mar 11 2021 at 15:00)</a>:</h4>
<p>But, with the PR, the idea is that for <code>T: Bar&lt;...&gt;</code> the lifetimes on that <em>includes</em> <code>'a</code>, so it no longer is escaping, and thus fails</p>



<a name="229862573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862573">(Mar 11 2021 at 15:01)</a>:</h4>
<p>(note that the <em>current</em> code is fine, because we keep around a debruijn index, but it's kind of weird because we're also always concatenating</p>



<a name="229862743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862743">(Mar 11 2021 at 15:02)</a>:</h4>
<p>When I remove the debruijn index locally and always use <code>0</code>, that's when things blow up</p>



<a name="229862912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862912">(Mar 11 2021 at 15:03)</a>:</h4>
<p>I'm finding this a bit confusing</p>



<a name="229862949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862949">(Mar 11 2021 at 15:03)</a>:</h4>
<p>why would you always use 0?</p>



<a name="229862955"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862955" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862955">(Mar 11 2021 at 15:03)</a>:</h4>
<p>maybe it helps to show me the desugared version</p>



<a name="229862978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229862978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229862978">(Mar 11 2021 at 15:04)</a>:</h4>
<p>(in the back of my mind, btw, I'm still contemplating the 'nest/flatten' approach)</p>



<a name="229863027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863027">(Mar 11 2021 at 15:04)</a>:</h4>
<p>(and trying to compare/contrast)</p>



<a name="229863048"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863048" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863048">(Mar 11 2021 at 15:04)</a>:</h4>
<p>Right so</p>



<a name="229863102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863102">(Mar 11 2021 at 15:04)</a>:</h4>
<p><code>fn foo&lt;'a, T&gt;() where T: Bar&lt;As = &amp;'a ()&gt;</code></p>



<a name="229863229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863229">(Mar 11 2021 at 15:05)</a>:</h4>
<p>Generates <code>for&lt;&gt; &lt;T as Bar&gt;::As = &amp;'^1.0 ()</code> today</p>



<a name="229863267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863267">(Mar 11 2021 at 15:05)</a>:</h4>
<p>Or at least, if we tracked vars that's what it would be</p>



<a name="229863418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863418">(Mar 11 2021 at 15:06)</a>:</h4>
<p>But, with these changes, we instead would generate <code>for&lt;'a&gt; &lt;T as Bar&gt;::As = &amp;'^0.0 ()</code></p>



<a name="229863450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863450">(Mar 11 2021 at 15:06)</a>:</h4>
<p>since we concatenate late vars always</p>



<a name="229863795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863795">(Mar 11 2021 at 15:08)</a>:</h4>
<p>are you saying we want to generate the latter?</p>



<a name="229863843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863843">(Mar 11 2021 at 15:08)</a>:</h4>
<p>this is confusing me a tiny bit because I expect <code>'a</code> to be early bound</p>



<a name="229863848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863848">(Mar 11 2021 at 15:08)</a>:</h4>
<p>am I correct?</p>



<a name="229863878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863878">(Mar 11 2021 at 15:08)</a>:</h4>
<p>(I would like to remove that distinction, of course, but for now it still exists...)</p>



<a name="229863921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229863921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229863921">(Mar 11 2021 at 15:09)</a>:</h4>
<p>oh, you're right</p>



<a name="229864000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864000">(Mar 11 2021 at 15:09)</a>:</h4>
<p>Okay, see <code>fn b&lt;T&gt;(items: &amp;[T]) -&gt; Box&lt;dyn Iterator&lt;Item=&amp;T&gt; + '_&gt; { ... }</code></p>



<a name="229864111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864111">(Mar 11 2021 at 15:10)</a>:</h4>
<p>There's an anonymous lifetime</p>



<a name="229864113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864113">(Mar 11 2021 at 15:10)</a>:</h4>
<p>ok</p>



<a name="229864202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864202">(Mar 11 2021 at 15:10)</a>:</h4>
<p>With this PR, the binders around <code>Item = &amp;T</code> would be <code>for&lt;anon&gt;</code></p>



<a name="229864238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864238">(Mar 11 2021 at 15:10)</a>:</h4>
<p>so <code>&amp;'0.0 T</code> instead of <code>&amp;'^1.0 T</code></p>



<a name="229864282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864282">(Mar 11 2021 at 15:11)</a>:</h4>
<p>So...we probably don't want to always be concatenating things</p>



<a name="229864530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864530">(Mar 11 2021 at 15:12)</a>:</h4>
<p>So the question is: if we do want to for the associated type bounds, is there any other places that it's okay? And why <em>is</em> it okay for associated type bounds? (Like, would we theoretically be <em>too strict</em> with ATBs if we concatenate?)</p>



<a name="229864985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229864985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229864985">(Mar 11 2021 at 15:14)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229864202">said</a>:</p>
<blockquote>
<p>With this PR, the binders around <code>Item = &amp;T</code> would be <code>for&lt;anon&gt;</code></p>
</blockquote>
<p>what happens today?</p>



<a name="229865136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865136">(Mar 11 2021 at 15:15)</a>:</h4>
<p>The anonymouse lifetime there as a debruijn index of 1</p>



<a name="229865256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865256">(Mar 11 2021 at 15:16)</a>:</h4>
<p>And the binders around Item = &amp;T (on the <code>dyn</code>) is empty</p>



<a name="229865620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865620">(Mar 11 2021 at 15:18)</a>:</h4>
<p>ok</p>



<a name="229865700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865700">(Mar 11 2021 at 15:18)</a>:</h4>
<p>so it's kind of equivaent to</p>



<a name="229865715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865715">(Mar 11 2021 at 15:19)</a>:</h4>
<p>As much as I like the <code>associated_type_bounds</code> feature, this is a pain in the butt</p>



<a name="229865768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865768">(Mar 11 2021 at 15:19)</a>:</h4>
<p><code>fn b&lt;'a, T&gt;(...) -&gt; Box&lt;dyn Iterator&lt;Item = &amp;'a T&gt;&gt;</code></p>



<a name="229865812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229865812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229865812">(Mar 11 2021 at 15:19)</a>:</h4>
<p>yes, exactly the same</p>



<a name="229866179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866179">(Mar 11 2021 at 15:21)</a>:</h4>
<p>The other problem that seems to come from concatenating vars like this stems from NLL. But I haven't been able to look into that at all</p>



<a name="229866208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866208">(Mar 11 2021 at 15:21)</a>:</h4>
<p>but I was seeing some things that looked really sus</p>



<a name="229866486"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866486" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866486">(Mar 11 2021 at 15:23)</a>:</h4>
<p>so .. it seems to me that we don't <em>want</em> to change this behavior</p>



<a name="229866497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866497">(Mar 11 2021 at 15:23)</a>:</h4>
<p>right</p>



<a name="229866512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866512">(Mar 11 2021 at 15:23)</a>:</h4>
<p>like this is meant to be a "no changes refactoring"</p>



<a name="229866527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866527">(Mar 11 2021 at 15:23)</a>:</h4>
<p>yes, at least not in the general case</p>



<a name="229866555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866555">(Mar 11 2021 at 15:23)</a>:</h4>
<p>But, for nested trait refs...maybe?</p>



<a name="229866563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866563">(Mar 11 2021 at 15:23)</a>:</h4>
<p>idk</p>



<a name="229866641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866641">(Mar 11 2021 at 15:24)</a>:</h4>
<p>what is a nested trait ref</p>



<a name="229866704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866704">(Mar 11 2021 at 15:24)</a>:</h4>
<p>with the associated type bounds</p>



<a name="229866739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866739">(Mar 11 2021 at 15:24)</a>:</h4>
<p><code>T: Foo&lt;As: Bar&gt;</code></p>



<a name="229866870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866870">(Mar 11 2021 at 15:25)</a>:</h4>
<p>what would be an example we might want to change?</p>



<a name="229866898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866898">(Mar 11 2021 at 15:25)</a>:</h4>
<p>I agree we can change that (unstable)</p>



<a name="229866904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229866904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229866904">(Mar 11 2021 at 15:25)</a>:</h4>
<p>I'd rather do it intensionally :)</p>



<a name="229867016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867016">(Mar 11 2021 at 15:26)</a>:</h4>
<p>well, the thing is, I think this is so underspecified that I don't know if this is <em>change</em> or a <em>choice</em></p>



<a name="229867019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867019">(Mar 11 2021 at 15:26)</a>:</h4>
<p>but</p>



<a name="229867117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867117">(Mar 11 2021 at 15:26)</a>:</h4>
<p>going back to <code>T: for&lt;'a&gt; Foo&lt;'a, As: for&lt;'b&gt; Bar&lt;'a, 'b&gt;&gt;</code></p>



<a name="229867141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867141">(Mar 11 2021 at 15:26)</a>:</h4>
<p>(now with lifetimes <span aria-label="sparkles" class="emoji emoji-2728" role="img" title="sparkles">:sparkles:</span>)</p>



<a name="229867187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867187">(Mar 11 2021 at 15:27)</a>:</h4>
<p>some part of me is tempted to remove this feature and re-implement it later:)</p>



<a name="229867196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867196">(Mar 11 2021 at 15:27)</a>:</h4>
<p>but anyway</p>



<a name="229867222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867222">(Mar 11 2021 at 15:27)</a>:</h4>
<p>Today, the debruijn index of the <code>'a</code> on <code>Bar</code> is <code>1</code>, with these changes it would be <code>0</code></p>



<a name="229867263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229867263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229867263">(Mar 11 2021 at 15:27)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/229867187">said</a>:</p>
<blockquote>
<p>some part of me is tempted to remove this feature and re-implement it later:)</p>
</blockquote>
<p>I thought about that. And then I looked through github for uses of the feature....too much</p>



<a name="229869199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229869199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229869199">(Mar 11 2021 at 15:38)</a>:</h4>
<p>But, at least my rational, is that by changing this to always concatenate vars in nested trait refs, that is more in line with what the desugaring of that is</p>



<a name="229898562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229898562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229898562">(Mar 11 2021 at 18:12)</a>:</h4>
<p>Okay so only doing concatenation in nested trait refs makes all tests pass</p>



<a name="229898614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229898614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229898614">(Mar 11 2021 at 18:12)</a>:</h4>
<p>And, modulo some cleanup, I think that I feel comfortable with that as a "final" state</p>



<a name="229898674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229898674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229898674">(Mar 11 2021 at 18:13)</a>:</h4>
<p>Curious to hear your thoughts <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="229925009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229925009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229925009">(Mar 11 2021 at 21:01)</a>:</h4>
<p>Hmm</p>



<a name="229927090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229927090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229927090">(Mar 11 2021 at 21:15)</a>:</h4>
<p>branch is updated (<a href="https://github.com/rust-lang/rust/compare/master...jackh726:binder-refactor-ohno">https://github.com/rust-lang/rust/compare/master...jackh726:binder-refactor-ohno</a>)</p>



<a name="229930239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229930239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229930239">(Mar 11 2021 at 21:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> see <a href="https://github.com/rust-lang/rust/issues/82743">#82743</a></p>



<a name="229966633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/229966633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#229966633">(Mar 12 2021 at 02:52)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> not sure if you wanted to talk tomorrow morning, but I'll be on at <time datetime="2021-03-12T14:00:00Z">2021-03-12T09:00:00-05:00</time> . Otherwise, probably start doing a real review of <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a>, because I think it's ready</p>



<a name="230009143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230009143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230009143">(Mar 12 2021 at 10:50)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> ok -- I left a review on <a href="https://github.com/rust-lang/rust/issues/82743">#82743</a>. I won't be around at 9am this morning (have another thing) but I can be around, I plan to do a lot of reviews today (including more time on <span class="user-mention" data-user-id="365822">@FireFighterDuck</span>'s PR)</p>



<a name="230062872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230062872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230062872">(Mar 12 2021 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> you around?</p>



<a name="230070441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230070441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230070441">(Mar 12 2021 at 17:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I added some comments that should hopefully address your thoughts</p>



<a name="230351587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230351587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230351587">(Mar 15 2021 at 14:19)</a>:</h4>
<p>Ping to take another look at <a href="https://github.com/rust-lang/rust/issues/82743">#82743</a> if you have time today <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="230390306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230390306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230390306">(Mar 15 2021 at 17:50)</a>:</h4>
<p>Sorry to jump in; I think you have modified rustdoc files by mistake? <code>src/librustdoc/html/static/FiraSans-Medium.woff2</code> has been modified somehow</p>



<a name="230390370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230390370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230390370">(Mar 15 2021 at 17:50)</a>:</h4>
<p>As well as <code>src/librustdoc/html/static/FiraSans-Regular.woff2</code></p>



<a name="230393806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230393806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230393806">(Mar 15 2021 at 18:15)</a>:</h4>
<p>oof</p>



<a name="230393819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230393819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230393819">(Mar 15 2021 at 18:15)</a>:</h4>
<p>how did that happen</p>



<a name="230397502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230397502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230397502">(Mar 15 2021 at 18:39)</a>:</h4>
<div class="codehilite"><pre><span></span><code>warning: CRLF will be replaced by LF in src/librustdoc/html/static/FiraSans-Regular.woff2.
The file will have its original line endings in your working directory.
</code></pre></div>
<p>...</p>



<a name="230400606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230400606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230400606">(Mar 15 2021 at 19:02)</a>:</h4>
<p>Should be fixed now. Turns out the git version on the server I use is old enough that it tries to change line-endings for <code>.woff2</code> files, which were recently added</p>



<a name="230590926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230590926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230590926">(Mar 16 2021 at 21:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> are you still looking over <a href="https://github.com/rust-lang/rust/issues/82743">#82743</a></p>



<a name="230590948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230590948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230590948">(Mar 16 2021 at 21:03)</a>:</h4>
<p>and/or is there anything about it that you want to talk about</p>



<a name="230763521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230763521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230763521">(Mar 17 2021 at 20:46)</a>:</h4>
<p>I am thinking about scheduling some time to go over the coinduction PR, and maybe i should do this PR review too</p>



<a name="230763537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230763537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230763537">(Mar 17 2021 at 20:46)</a>:</h4>
<p>I think <span class="user-mention" data-user-id="232957">@Jack Huey</span> I was not happy with the "two modes"</p>



<a name="230763543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230763543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230763543">(Mar 17 2021 at 20:46)</a>:</h4>
<p>and i was trying to convince myself whether it was needed</p>



<a name="230764251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764251">(Mar 17 2021 at 20:51)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="230764269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764269">(Mar 17 2021 at 20:51)</a>:</h4>
<p>Okay so,</p>



<a name="230764475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764475">(Mar 17 2021 at 20:52)</a>:</h4>
<p>the motivating example for the split was</p>
<div class="codehilite"><pre><span></span><code>pub trait HInt: Int {
    type D: DInt&lt;H = Self&gt; + Int;
}
pub trait DInt: Int {
    type H: HInt&lt;D = Self&gt; + Int;
}
</code></pre></div>



<a name="230764579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764579">(Mar 17 2021 at 20:53)</a>:</h4>
<p>On it's own, this isn't needed for <a href="https://github.com/rust-lang/rust/issues/82743">#82743</a></p>



<a name="230764623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764623">(Mar 17 2021 at 20:53)</a>:</h4>
<p>But mixed with <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a>, it is</p>



<a name="230764814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764814">(Mar 17 2021 at 20:54)</a>:</h4>
<p>hmm</p>



<a name="230764815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764815">(Mar 17 2021 at 20:54)</a>:</h4>
<p>Because, in <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a>, when we do lifetime resolution, we get to <code>HInt</code> (in the <code>DInt</code> defintion) and ask "where is <code>D</code> defined on the trait <code>HInt</code>"</p>



<a name="230764817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764817">(Mar 17 2021 at 20:54)</a>:</h4>
<p>ok</p>



<a name="230764933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230764933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230764933">(Mar 17 2021 at 20:55)</a>:</h4>
<p>So we then we go try to resolve lifetimes for <code>HInt</code>. Without splitting trait definitions, we get to <code>DInt</code> and a cycle happens</p>



<a name="230765139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230765139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230765139">(Mar 17 2021 at 20:57)</a>:</h4>
<p>If you have a more elegant way to handle this, I would love to hear it though :)</p>



<a name="230854803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230854803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230854803">(Mar 18 2021 at 12:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I will rebase when you've finished your review</p>



<a name="230864263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/230864263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#230864263">(Mar 18 2021 at 13:40)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> ok</p>



<a name="231086448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231086448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231086448">(Mar 19 2021 at 20:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> poke :)</p>



<a name="231446435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231446435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231446435">(Mar 23 2021 at 10:10)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> Sorry :) I don't really understand this motivating example, I have to say</p>



<a name="231468095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231468095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231468095">(Mar 23 2021 at 13:18)</a>:</h4>
<p>What do you mean?</p>



<a name="231468136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231468136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231468136">(Mar 23 2021 at 13:18)</a>:</h4>
<p>This is literally pulled from <code>compiler_builtins</code></p>



<a name="231468316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231468316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231468316">(Mar 23 2021 at 13:19)</a>:</h4>
<p>The associated type of <code>DInt</code> references <code>HInt</code> and vice-versa</p>



<a name="231468394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231468394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231468394">(Mar 23 2021 at 13:20)</a>:</h4>
<p>You can probably ignore the <code>Int</code> bounds and it's the same problem</p>



<a name="231496860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231496860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231496860">(Mar 23 2021 at 16:08)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do you need/want to discuss this</p>



<a name="231527448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527448">(Mar 23 2021 at 19:17)</a>:</h4>
<p>what I mean is</p>



<a name="231527472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527472">(Mar 23 2021 at 19:17)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> can we schedule a time to do it?</p>



<a name="231527490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527490">(Mar 23 2021 at 19:17)</a>:</h4>
<p>maybe tomorrow ?</p>



<a name="231527504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527504">(Mar 23 2021 at 19:18)</a>:</h4>
<p>I was thinking I wanted to schedule some trait times to do reviews and discussion</p>



<a name="231527560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527560">(Mar 23 2021 at 19:18)</a>:</h4>
<p>but what I meant was -- I didn't see how that example per se motivated the split :)</p>



<a name="231527575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231527575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231527575">(Mar 23 2021 at 19:18)</a>:</h4>
<p>If it's tomorrow morning, like 9ish, yes</p>



<a name="231528556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231528556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231528556">(Mar 23 2021 at 19:23)</a>:</h4>
<p>So, without the split, imagine we want to resolve lifetimes <code>HInt</code>. As part of that, we see <code>DInt</code>. But in the binder refactor, we need to know possible lifetimes from super trait HRTBs on <code>DInt</code>. Now, in <em>this</em> example, there aren't any, but we don't know that. So we ask "what are the lifetimes from super trait HRTBs on <code>DInt</code>". To do that, we have to resolve lifetimes on <code>DInt</code>. Now, if we naively resolve <em>all</em> lifetimes, we'll get to <code>type H: HInt&lt;D = Self&gt; + Int;</code> and end up in a cycle. So instead, we only look at the <code>DInt: Int</code> part of the definition (If we had something like <code>Foo&lt;'a&gt;: for&lt;'b&gt; Bar&lt;'a, 'b&gt;</code> then we visit that entire thing). I guess it's also important that we know that <code>H</code> is defined on <code>DInt</code> (not <code>Int</code>) without resolving lifetimes.</p>



<a name="231628794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231628794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231628794">(Mar 24 2021 at 13:00)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> you're around?</p>



<a name="231629255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629255">(Mar 24 2021 at 13:03)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> yes!</p>



<a name="231629269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629269">(Mar 24 2021 at 13:03)</a>:</h4>
<p>had to get coffee</p>



<a name="231629275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629275">(Mar 24 2021 at 13:03)</a>:</h4>
<p>Howdy :)</p>



<a name="231629295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629295">(Mar 24 2021 at 13:03)</a>:</h4>
<p>Coffee is important</p>



<a name="231629309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629309">(Mar 24 2021 at 13:03)</a>:</h4>
<p>Need to get those brains cells moving</p>



<a name="231629426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629426">(Mar 24 2021 at 13:04)</a>:</h4>
<p>now I just have to drink it</p>



<a name="231629438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629438">(Mar 24 2021 at 13:04)</a>:</h4>
<p>but let's get started :)</p>



<a name="231629469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629469">(Mar 24 2021 at 13:05)</a>:</h4>
<p>ps cc <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span></p>



<a name="231629487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629487">(Mar 24 2021 at 13:05)</a>:</h4>
<p>Wait, I'm a scientist, I can be more accurate: Gotta get those brain cells <em>firing</em></p>



<a name="231629529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629529">(Mar 24 2021 at 13:05)</a>:</h4>
<p>Okay, so let's start with...the resolve refactor</p>



<a name="231629548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629548">(Mar 24 2021 at 13:05)</a>:</h4>
<p>/me tries to remember PR number</p>



<a name="231629624"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629624" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629624">(Mar 24 2021 at 13:06)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/82743">#82743</a></p>



<a name="231629650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629650">(Mar 24 2021 at 13:06)</a>:</h4>
<p>sadly there is no :white-lab-coat: emoji</p>



<a name="231629703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629703">(Mar 24 2021 at 13:06)</a>:</h4>
<p>I remember talking to some computer scientists from a research lab in Big Company That Will Not Be Named</p>



<a name="231629729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629729">(Mar 24 2021 at 13:06)</a>:</h4>
<p>they had made a movie highlighting some of their new Javascript APIs</p>



<a name="231629740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629740">(Mar 24 2021 at 13:07)</a>:</h4>
<p>and the filmmakers made them wear white lab coats</p>



<a name="231629755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629755">(Mar 24 2021 at 13:07)</a>:</h4>
<p>I found this unendingly funny</p>



<a name="231629774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629774">(Mar 24 2021 at 13:07)</a>:</h4>
<p>That is absolutely perfect</p>



<a name="231629916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629916">(Mar 24 2021 at 13:08)</a>:</h4>
<p>Okay, so I figure that we can start by just going through <em>why</em> this PR is necessary</p>



<a name="231629958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629958">(Mar 24 2021 at 13:08)</a>:</h4>
<p>sounds like a plan</p>



<a name="231629970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629970">(Mar 24 2021 at 13:08)</a>:</h4>
<p>let me tile some windows here..</p>



<a name="231629979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231629979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231629979">(Mar 24 2021 at 13:08)</a>:</h4>
<p>And hopefully the implementation is straightforward from there</p>



<a name="231630088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630088">(Mar 24 2021 at 13:09)</a>:</h4>
<p>So, maybe let's start with: What's your understanding so far?</p>



<a name="231630151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630151">(Mar 24 2021 at 13:09)</a>:</h4>
<p>well this PR seems obviously better</p>



<a name="231630157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630157">(Mar 24 2021 at 13:09)</a>:</h4>
<p>just from first principles :)</p>



<a name="231630181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630181">(Mar 24 2021 at 13:09)</a>:</h4>
<p>but I guess I don't 100% know why it's <em>necessary</em></p>



<a name="231630209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630209">(Mar 24 2021 at 13:09)</a>:</h4>
<p>I'm reading your PR description now</p>



<a name="231630278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630278">(Mar 24 2021 at 13:10)</a>:</h4>
<blockquote>
<p>The reason behind this change will (hopefully) allow us to (as part of <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a>) be able to essentially use the lifetime resolve code to resolve all late bound vars (including those of super traits).</p>
</blockquote>



<a name="231630306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630306">(Mar 24 2021 at 13:10)</a>:</h4>
<p>so I guess that we need to be more fine-grained</p>



<a name="231630326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630326">(Mar 24 2021 at 13:10)</a>:</h4>
<p>but I don't 100% know why</p>



<a name="231630332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630332">(Mar 24 2021 at 13:10)</a>:</h4>
<p>I should remove that "(hopefully)" because turns out it does work as expected</p>



<a name="231630366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630366">(Mar 24 2021 at 13:10)</a>:</h4>
<p>Okay, let me write a bit of code</p>



<a name="231630563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630563">(Mar 24 2021 at 13:12)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">foo</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span>: <span class="nc">Bar</span><span class="o">&lt;'</span><span class="na">foo</span><span class="p">,</span><span class="w"> </span><span class="n">As</span><span class="o">=&amp;'</span><span class="na">foo</span><span class="w"> </span><span class="p">()</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">type</span> <span class="nc">As</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">type</span> <span class="nc">Bar</span><span class="o">&lt;'</span><span class="na">b</span><span class="o">&gt;</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="231630567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630567">(Mar 24 2021 at 13:12)</a>:</h4>
<p>ok</p>



<a name="231630640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630640">(Mar 24 2021 at 13:12)</a>:</h4>
<p>Alright so</p>



<a name="231630662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630662">(Mar 24 2021 at 13:12)</a>:</h4>
<p>Well, let me change it just a bit</p>



<a name="231630817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630817">(Mar 24 2021 at 13:13)</a>:</h4>
<p>Okay, so let's imagine we're going to type check <code>foo</code></p>



<a name="231630874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630874">(Mar 24 2021 at 13:14)</a>:</h4>
<p>And we ask "what are the predicates for <code>foo</code>"</p>



<a name="231630904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231630904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231630904">(Mar 24 2021 at 13:14)</a>:</h4>
<p>tip: use <code>```rust</code></p>



<a name="231631010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631010">(Mar 24 2021 at 13:14)</a>:</h4>
<p>ok</p>



<a name="231631084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631084">(Mar 24 2021 at 13:15)</a>:</h4>
<p>Now, without going into all of the details, we eventually end up calling <code>instantiate_poly_trait_ref</code> on the <code>T: Bar&lt;'foo, As=&amp;'foo ()&gt;</code> bound</p>



<a name="231631142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631142">(Mar 24 2021 at 13:15)</a>:</h4>
<p>wait</p>



<a name="231631201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631201">(Mar 24 2021 at 13:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231630874">said</a>:</p>
<blockquote>
<p>And we ask "what are the predicates for <code>Foo</code>"</p>
</blockquote>
<p>did you mean <code>foo</code></p>



<a name="231631212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631212">(Mar 24 2021 at 13:16)</a>:</h4>
<p>And in there, we call many <code>ast_region_to_region</code> and <code>ast_ty_to_ty</code></p>



<a name="231631256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631256">(Mar 24 2021 at 13:16)</a>:</h4>
<p>yes yes</p>



<a name="231631257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631257">(Mar 24 2021 at 13:16)</a>:</h4>
<p>sorry</p>



<a name="231631332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631332">(Mar 24 2021 at 13:16)</a>:</h4>
<p>(I'll get there though)</p>



<a name="231631386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631386">(Mar 24 2021 at 13:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231631201">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231630874">said</a>:</p>
<blockquote>
<p>And we ask "what are the predicates for <code>Foo</code>"</p>
</blockquote>
<p>did you mean <code>foo</code></p>
</blockquote>
<p>was wondering the same but at some point you need predicates of <code>Foo</code> too, so I though Jack was talking about that</p>



<a name="231631429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631429">(Mar 24 2021 at 13:17)</a>:</h4>
<p>right, but it didn't make sense to from <code>Foo</code> to <code>T: Bar&lt;'...&gt;</code></p>



<a name="231631436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631436">(Mar 24 2021 at 13:17)</a>:</h4>
<p>anyway, carry on</p>



<a name="231631474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631474">(Mar 24 2021 at 13:17)</a>:</h4>
<p>So, still type checking <code>foo</code>, we want it's predicates, and we have to convert hir regions to ty regions, <em>and so we have to call <code>resolve_lifetimes</code></em></p>



<a name="231631556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631556">(Mar 24 2021 at 13:18)</a>:</h4>
<p>confirm</p>



<a name="231631621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631621">(Mar 24 2021 at 13:18)</a>:</h4>
<p>now a bit of a side-step</p>



<a name="231631744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631744">(Mar 24 2021 at 13:19)</a>:</h4>
<p>In the binder refactor PR, in order to handle super trait HRTBs and making sure that we get the index of all the vars right, we want to be able to know all the lifetimes from super trait HRTBs <em>that would be in scope</em></p>



<a name="231631851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631851">(Mar 24 2021 at 13:20)</a>:</h4>
<p>We can/will go over that separately, but let's take that mostly as fact right now</p>



<a name="231631948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231631948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231631948">(Mar 24 2021 at 13:20)</a>:</h4>
<p>ok. I still don't want this to be true but I also want to land the PR and argue about it later, so <span aria-label="zip it" class="emoji emoji-1f910" role="img" title="zip it">:zip_it:</span></p>



<a name="231632013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632013">(Mar 24 2021 at 13:21)</a>:</h4>
<p>Want what to be true?</p>



<a name="231632037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632037">(Mar 24 2021 at 13:21)</a>:</h4>
<p>I don't want us to have to know that</p>



<a name="231632094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632094">(Mar 24 2021 at 13:21)</a>:</h4>
<p>Unfortunately I don't know if there's a better way to do it</p>



<a name="231632097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632097">(Mar 24 2021 at 13:21)</a>:</h4>
<p>Or at least, I still believe that creating some intermediate form that gets flattened might be a nicer way to manage that</p>



<a name="231632235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632235">(Mar 24 2021 at 13:22)</a>:</h4>
<p>The problem with that is there is so much code that calls <code>ast_ty_to_ty</code> after we've already gone through levels of binders</p>



<a name="231632267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632267">(Mar 24 2021 at 13:22)</a>:</h4>
<p>so you have to do that "flattening" before <code>ast_ty_to_ty</code></p>



<a name="231632328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632328">(Mar 24 2021 at 13:23)</a>:</h4>
<p>And really, <code>rustc_resolve::late::lifetimes</code> <em>is</em> essentially flattening</p>



<a name="231632330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632330">(Mar 24 2021 at 13:23)</a>:</h4>
<p>ok, carry on</p>



<a name="231632352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632352">(Mar 24 2021 at 13:23)</a>:</h4>
<p>I still don't like it but I'm prepared to concede you may be right (for now)</p>



<a name="231632373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632373">(Mar 24 2021 at 13:23)</a>:</h4>
<p>something feels off to me is all</p>



<a name="231632381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632381">(Mar 24 2021 at 13:23)</a>:</h4>
<p>like it could be made simpler</p>



<a name="231632397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632397">(Mar 24 2021 at 13:23)</a>:</h4>
<p>Turns out this actually only really matters within nested trait refs anyways</p>



<a name="231632454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632454">(Mar 24 2021 at 13:24)</a>:</h4>
<p>otherwise we wouldn't have to care at all and <code>subst_supertrait</code> is sufficient</p>



<a name="231632527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632527">(Mar 24 2021 at 13:24)</a>:</h4>
<p>Anyways, let me finish the motivation then we can circle back later</p>



<a name="231632636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632636">(Mar 24 2021 at 13:25)</a>:</h4>
<p>yes I was supposed to be <span aria-label="zip it" class="emoji emoji-1f910" role="img" title="zip it">:zip_it:</span></p>



<a name="231632642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632642">(Mar 24 2021 at 13:25)</a>:</h4>
<p>I blame you :)</p>



<a name="231632679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632679">(Mar 24 2021 at 13:25)</a>:</h4>
<p>So, now, we see <code>T: Bar&lt;'foo, As=&amp;'foo ()&gt;</code></p>



<a name="231632752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632752">(Mar 24 2021 at 13:26)</a>:</h4>
<p>In <code>resolve_lifetimes</code></p>



<a name="231632871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632871">(Mar 24 2021 at 13:27)</a>:</h4>
<p>And we ask "What are the super trait lifetimes in scope for the <code>As=&amp;'foo</code> predicate?"</p>



<a name="231632930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231632930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231632930">(Mar 24 2021 at 13:27)</a>:</h4>
<p>So, we essentially go through the tree <code>Bar</code> -&gt; <code>Foo</code> to find where <code>As</code> is defined</p>



<a name="231633003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633003">(Mar 24 2021 at 13:28)</a>:</h4>
<p>But as part of this, <em>we have to instantiate the <code>Bar&lt;'b&gt;: for&lt;'a&gt; Foo&lt;'a, 'b&gt;</code> trait ref</em></p>



<a name="231633072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633072">(Mar 24 2021 at 13:28)</a>:</h4>
<p>And that requires...you guessed it...<code>resolve_lifetimes</code></p>



<a name="231633109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633109">(Mar 24 2021 at 13:28)</a>:</h4>
<p>and so now, we're in a cycle</p>



<a name="231633118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633118">(Mar 24 2021 at 13:28)</a>:</h4>
<p>so</p>



<a name="231633140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633140">(Mar 24 2021 at 13:28)</a>:</h4>
<p>because currently, <code>resolve_lifetimes</code> gets called <em>per-crate</em></p>



<a name="231633160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633160">(Mar 24 2021 at 13:29)</a>:</h4>
<p>I am happy with this motivation but I have a question</p>



<a name="231633191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633191">(Mar 24 2021 at 13:29)</a>:</h4>
<p>do truly need to <em>instantiate the trait ref</em> or do we only need to know the trait's defid</p>



<a name="231633348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633348">(Mar 24 2021 at 13:30)</a>:</h4>
<p>Well, we really only need the <code>DefId</code>, but we have to <code>resolve_lifetimes</code> to know whether or not the <code>'a</code> and <code>'b</code> there are late-bound or not</p>



<a name="231633603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633603">(Mar 24 2021 at 13:31)</a>:</h4>
<p>which I gues we need to know because late-bound regions will end up in the binder in the end</p>



<a name="231633620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633620">(Mar 24 2021 at 13:31)</a>:</h4>
<p>yes</p>



<a name="231633631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633631">(Mar 24 2021 at 13:31)</a>:</h4>
<p>ok</p>



<a name="231633679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633679">(Mar 24 2021 at 13:32)</a>:</h4>
<p>so now can we walk through the two modes :)</p>



<a name="231633703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633703">(Mar 24 2021 at 13:32)</a>:</h4>
<p>as I said, making things per-item is better from first principles regardless</p>



<a name="231633732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633732">(Mar 24 2021 at 13:32)</a>:</h4>
<p>Actually, in <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a>, I only care about <code>DefId</code>, but also can't use any existing machinery because have to keep track of the late-bound lifetimes too</p>



<a name="231633759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633759">(Mar 24 2021 at 13:32)</a>:</h4>
<p>right okay, two modes</p>



<a name="231633825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633825">(Mar 24 2021 at 13:33)</a>:</h4>
<p>(quick note: we don't have to worry about cycles because..supertraits are acyclic?)</p>



<a name="231633865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633865">(Mar 24 2021 at 13:33)</a>:</h4>
<p>yes</p>



<a name="231633877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633877">(Mar 24 2021 at 13:33)</a>:</h4>
<p>(that's a restriction I want to lift but never mind)</p>



<a name="231633894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231633894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231633894">(Mar 24 2021 at 13:33)</a>:</h4>
<p>(not in the short term:)</p>



<a name="231634046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634046">(Mar 24 2021 at 13:34)</a>:</h4>
<p>So, we just went through why we're calling <code>resolve_lifetimes</code> on a different trait when trying to <code>resolve_lifetimes</code> on one</p>



<a name="231634081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634081">(Mar 24 2021 at 13:34)</a>:</h4>
<p>Well, I guess we didn't quite</p>



<a name="231634120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634120">(Mar 24 2021 at 13:34)</a>:</h4>
<p>But you could imagine that you have an extra level of super traits there</p>



<a name="231634153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634153">(Mar 24 2021 at 13:35)</a>:</h4>
<p>And you have to instantiate the trait ref of both "sub traits"</p>



<a name="231634225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634225">(Mar 24 2021 at 13:35)</a>:</h4>
<p>Does that make sense?</p>



<a name="231634235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634235">(Mar 24 2021 at 13:35)</a>:</h4>
<p>Or do I need to write an example</p>



<a name="231634325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634325">(Mar 24 2021 at 13:36)</a>:</h4>
<p>(While I wait, I'll type)</p>



<a name="231634410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634410">(Mar 24 2021 at 13:37)</a>:</h4>
<p>well, actually forget that example</p>



<a name="231634438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634438">(Mar 24 2021 at 13:37)</a>:</h4>
<p>let's go back to that "motivating example" I showed the other day</p>



<a name="231634466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634466">(Mar 24 2021 at 13:37)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">HInt</span>: <span class="nc">Int</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">D</span>: <span class="nc">DInt</span><span class="o">&lt;</span><span class="n">H</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">Int</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">DInt</span>: <span class="nc">Int</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">H</span>: <span class="nc">HInt</span><span class="o">&lt;</span><span class="n">D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">Int</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="231634537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634537">(Mar 24 2021 at 13:38)</a>:</h4>
<p>So, now knowing what we know so far</p>



<a name="231634588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634588">(Mar 24 2021 at 13:38)</a>:</h4>
<p>imagine elsewhere we have <code>T: HInt&lt;D = u32&gt;</code></p>



<a name="231634650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634650">(Mar 24 2021 at 13:38)</a>:</h4>
<p>ok</p>



<a name="231634667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634667">(Mar 24 2021 at 13:39)</a>:</h4>
<p>We eventually ask "What lifetimes come from super trait HRTBs on the <code>D = u32</code> bound?"</p>



<a name="231634710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634710">(Mar 24 2021 at 13:39)</a>:</h4>
<p>ok</p>



<a name="231634720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634720">(Mar 24 2021 at 13:39)</a>:</h4>
<p>before we go further let me back up</p>



<a name="231634724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634724">(Mar 24 2021 at 13:39)</a>:</h4>
<p>the two modes:</p>



<a name="231634743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634743">(Mar 24 2021 at 13:39)</a>:</h4>
<p>So then we try to instantiate <code>HInt: Int</code></p>



<a name="231634750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634750">(Mar 24 2021 at 13:39)</a>:</h4>
<p>Ok, pausing</p>



<a name="231634808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634808">(Mar 24 2021 at 13:40)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="sd">/// Indicates that we only care about the definition of a trait. This should</span>
<span class="sd">/// be false if the `Item` we are resolving lifetimes for is not a trait or</span>
<span class="sd">/// we eventually need lifetimes resolve for trait items.</span>
<span class="n">trait_definition_only</span>: <span class="kt">bool</span><span class="p">,</span><span class="w"></span>
</code></pre></div>



<a name="231634906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634906">(Mar 24 2021 at 13:40)</a>:</h4>
<p>this affects a few bits of code</p>



<a name="231634914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634914">(Mar 24 2021 at 13:40)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">    </span><span class="k">fn</span> <span class="nf">visit_trait_item_ref</span><span class="p">(</span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">ii</span>: <span class="kp">&amp;</span><span class="o">'</span><span class="na">tcx</span> <span class="nc">hir</span>::<span class="n">TraitItemRef</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">if</span><span class="w"> </span><span class="o">!</span><span class="bp">self</span><span class="p">.</span><span class="n">trait_definition_only</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="n">intravisit</span>::<span class="n">walk_trait_item_ref</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">ii</span><span class="p">)</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="231634973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231634973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231634973">(Mar 24 2021 at 13:41)</a>:</h4>
<blockquote>
<div class="codehilite"><pre><span></span><code>                                        &quot;`impl Trait` can only capture lifetimes \
</code></pre></div>

</blockquote>



<a name="231635005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635005">(Mar 24 2021 at 13:41)</a>:</h4>
<p>I'm trying to decide if I have a question</p>



<a name="231635040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635040">(Mar 24 2021 at 13:41)</a>:</h4>
<p>So, right <code>trait_definition_only</code></p>



<a name="231635041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635041">(Mar 24 2021 at 13:41)</a>:</h4>
<p>i guess it was kind of ... "I want to understand why each of these bits of code should do the opposite in the other mode"</p>



<a name="231635070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635070">(Mar 24 2021 at 13:42)</a>:</h4>
<p>I will explain :)</p>



<a name="231635118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635118">(Mar 24 2021 at 13:42)</a>:</h4>
<p>carry on</p>



<a name="231635185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635185">(Mar 24 2021 at 13:42)</a>:</h4>
<p><code>trait_definition_only</code> should only be true if we're resolving lifetimes in essentially the "trait ref of a trait"</p>



<a name="231635205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635205">(Mar 24 2021 at 13:42)</a>:</h4>
<p>i.e. <code>Bar&lt;'b&gt;: for&lt;'a&gt; Foo&lt;'a, 'b&gt;</code></p>



<a name="231635307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635307">(Mar 24 2021 at 13:43)</a>:</h4>
<p>Everywhere else, i.e. other items or in associated items for traits, it is false</p>



<a name="231635445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635445">(Mar 24 2021 at 13:44)</a>:</h4>
<p>But also importantly (and this is what <span class="user-mention silent" data-user-id="248906">cjgillot</span>'s comment was): when <code>trait_defintion_only</code> is false we <em>still</em> visit the <code>Bar&lt;'b&gt;: for&lt;'a&gt; Foo&lt;'a, 'b&gt;</code></p>



<a name="231635488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635488">(Mar 24 2021 at 13:44)</a>:</h4>
<p>And this essentially comes back to diagnostics/warnings</p>



<a name="231635578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635578">(Mar 24 2021 at 13:45)</a>:</h4>
<p>(I think)</p>



<a name="231635588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635588">(Mar 24 2021 at 13:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231635205">said</a>:</p>
<blockquote>
<p>i.e. <code>Bar&lt;'b&gt;: for&lt;'a&gt; Foo&lt;'a, 'b&gt;</code></p>
</blockquote>
<p>I don't really undesrtand this yet</p>



<a name="231635595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635595">(Mar 24 2021 at 13:45)</a>:</h4>
<p>we invoke resolve-lifetimes on items, right?</p>



<a name="231635615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635615">(Mar 24 2021 at 13:45)</a>:</h4>
<p>yes</p>



<a name="231635665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635665">(Mar 24 2021 at 13:46)</a>:</h4>
<p>but we can ask for the <code>named_region</code> of <code>'b</code></p>



<a name="231635724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635724">(Mar 24 2021 at 13:46)</a>:</h4>
<p>and that gets the item that "owns" it, i.e. the trait</p>



<a name="231635765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635765">(Mar 24 2021 at 13:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231635205">said</a>:</p>
<blockquote>
<p>i.e. <code>Bar&lt;'b&gt;: for&lt;'a&gt; Foo&lt;'a, 'b&gt;</code></p>
</blockquote>
<p>is this the "super trait"</p>



<a name="231635776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635776">(Mar 24 2021 at 13:46)</a>:</h4>
<p>and calls <code>resolve_lifetimes</code> (or really, here, <code>resolve_lifetimes_trait_definition</code>)</p>



<a name="231635802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635802">(Mar 24 2021 at 13:46)</a>:</h4>
<p>yes</p>



<a name="231635840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635840">(Mar 24 2021 at 13:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231635665">said</a>:</p>
<blockquote>
<p>but we can ask for the <code>named_region</code> of <code>'b</code></p>
</blockquote>
<p>can you tie this to the code?</p>



<a name="231635870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635870">(Mar 24 2021 at 13:47)</a>:</h4>
<p>is it <code>named_region_map</code>?</p>



<a name="231635883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635883">(Mar 24 2021 at 13:47)</a>:</h4>
<p>yes</p>



<a name="231635917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635917">(Mar 24 2021 at 13:47)</a>:</h4>
<p>one sec</p>



<a name="231635970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231635970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231635970">(Mar 24 2021 at 13:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/680d9fcac1dec4b671707e0ffc6bf95ac7115ebe/compiler/rustc_middle/src/ty/context.rs#L2643">https://github.com/rust-lang/rust/blob/680d9fcac1dec4b671707e0ffc6bf95ac7115ebe/compiler/rustc_middle/src/ty/context.rs#L2643</a></p>



<a name="231636073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636073">(Mar 24 2021 at 13:48)</a>:</h4>
<p>from the PR I see</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">         </span><span class="n">named_region_map</span>: <span class="o">|</span><span class="n">tcx</span><span class="p">,</span><span class="w"> </span><span class="n">id</span><span class="o">|</span><span class="w"> </span><span class="n">resolve_lifetimes_for</span><span class="p">(</span><span class="n">tcx</span><span class="p">,</span><span class="w"> </span><span class="n">id</span><span class="p">).</span><span class="n">defs</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="o">&amp;</span><span class="n">id</span><span class="p">),</span><span class="w"></span>
</code></pre></div>



<a name="231636130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636130">(Mar 24 2021 at 13:48)</a>:</h4>
<p>So the <code>id</code> there is the id of the <em>owner</em> of a lifetime</p>



<a name="231636155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636155">(Mar 24 2021 at 13:49)</a>:</h4>
<p>So, either the <code>Item</code> if it's like the trait ref of a trait</p>



<a name="231636179"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636179" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636179">(Mar 24 2021 at 13:49)</a>:</h4>
<p>Or the <code>function</code> if it's in a where clause</p>



<a name="231636194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636194">(Mar 24 2021 at 13:49)</a>:</h4>
<p>etc.</p>



<a name="231636258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636258">(Mar 24 2021 at 13:49)</a>:</h4>
<p>(pre-existing, but we should be documenting these things)</p>



<a name="231636287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636287">(Mar 24 2021 at 13:49)</a>:</h4>
<p>ah, maybe it is</p>



<a name="231636358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636358">(Mar 24 2021 at 13:50)</a>:</h4>
<p>in that <code>resolve_lifetimes_for</code> has a nice comment</p>



<a name="231636363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636363">(Mar 24 2021 at 13:50)</a>:</h4>
<blockquote>
<p>fn resolve_lifetimes_for&lt;'tcx&gt;(tcx: TyCtxt&lt;'tcx&gt;, def_id: LocalDefId) -&gt; &amp;'tcx ResolveLifetimes {</p>
</blockquote>



<a name="231636397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636397">(Mar 24 2021 at 13:50)</a>:</h4>
<p>The documentation is a bit scattered</p>



<a name="231636432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636432">(Mar 24 2021 at 13:50)</a>:</h4>
<p>/// Second, if we are asking for lifetimes in a trait <em>definition</em>, we use <code>resolve_lifetimes_trait_definition</code><br>
/// instead of <code>resolve_lifetimes</code>, which does not descend into the trait items and does not emit diagnostics.</p>



<a name="231636449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636449">(Mar 24 2021 at 13:50)</a>:</h4>
<p>that's the part I'm still struggling to understand though</p>



<a name="231636458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636458">(Mar 24 2021 at 13:50)</a>:</h4>
<p>I don't quite like that <code>named_region</code> and similar counterparts are in <code>ty/context</code></p>



<a name="231636488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636488">(Mar 24 2021 at 13:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231636449">said</a>:</p>
<blockquote>
<p>that's the part I'm still struggling to understand though</p>
</blockquote>
<p>right</p>



<a name="231636513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636513">(Mar 24 2021 at 13:51)</a>:</h4>
<p>should I continue then</p>



<a name="231636545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636545">(Mar 24 2021 at 13:51)</a>:</h4>
<p>I guess :)</p>



<a name="231636554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636554">(Mar 24 2021 at 13:51)</a>:</h4>
<p>yes!</p>



<a name="231636563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636563">(Mar 24 2021 at 13:51)</a>:</h4>
<p>I'm just reading into the code a bit at the same time</p>



<a name="231636609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636609">(Mar 24 2021 at 13:51)</a>:</h4>
<p>Let me explain first why the split is necessary</p>



<a name="231636613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636613">(Mar 24 2021 at 13:51)</a>:</h4>
<p>I should load this into vscode</p>



<a name="231636714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636714">(Mar 24 2021 at 13:52)</a>:</h4>
<p>and then second how we define the <em>split</em></p>



<a name="231636783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636783">(Mar 24 2021 at 13:52)</a>:</h4>
<p>But I think it might be helpful to think of <code>resolve_lifetimes_trait_defintion</code> as really only a small and duplicated subset of <code>resolve_lifetimes</code></p>



<a name="231636819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636819">(Mar 24 2021 at 13:53)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231634743">said</a>:</p>
<blockquote>
<p>So then we try to instantiate <code>HInt: Int</code></p>
</blockquote>
<p>starting here</p>



<a name="231636917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636917">(Mar 24 2021 at 13:53)</a>:</h4>
<p>(from the supertrait?)</p>



<a name="231636976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636976">(Mar 24 2021 at 13:54)</a>:</h4>
<p>yes</p>



<a name="231636998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231636998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231636998">(Mar 24 2021 at 13:54)</a>:</h4>
<p>let me back up a bit more</p>



<a name="231637009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637009">(Mar 24 2021 at 13:54)</a>:</h4>
<p>also to help myself get orientated</p>



<a name="231637054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637054">(Mar 24 2021 at 13:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231634466">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">HInt</span>: <span class="nc">Int</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">D</span>: <span class="nc">DInt</span><span class="o">&lt;</span><span class="n">H</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">Int</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">DInt</span>: <span class="nc">Int</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">H</span>: <span class="nc">HInt</span><span class="o">&lt;</span><span class="n">D</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">Int</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>here</p>



<a name="231637163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637163">(Mar 24 2021 at 13:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231634588">said</a>:</p>
<blockquote>
<p>imagine elsewhere we have <code>T: HInt&lt;D = u32&gt;</code></p>
</blockquote>
<p>and this</p>



<a name="231637239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637239">(Mar 24 2021 at 13:55)</a>:</h4>
<p>We ask, "what lifetimes from super trait HRTBs are there on <code>D = u32</code>"</p>



<a name="231637356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637356">(Mar 24 2021 at 13:56)</a>:</h4>
<p>So then we go to <code>HInt: Int</code></p>



<a name="231637440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637440">(Mar 24 2021 at 13:56)</a>:</h4>
<p>eventually call <code>resolve_lifetimes</code> (I'm blanking on exactly why, but we're low on time, so going to try to power through)</p>



<a name="231637546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637546">(Mar 24 2021 at 13:57)</a>:</h4>
<p>err, actually, I don't think this particular cycle starts from a separate trait ref</p>



<a name="231637566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637566">(Mar 24 2021 at 13:57)</a>:</h4>
<p>because that doesn't make sense</p>



<a name="231637609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637609">(Mar 24 2021 at 13:58)</a>:</h4>
<p>I think this just happens when we get to <code>D: DInt&lt;H = Self&gt; + Int</code> <em>normally</em></p>



<a name="231637708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637708">(Mar 24 2021 at 13:58)</a>:</h4>
<p>I think I just don't expect <code>resolve_lifetimes</code> to resolve the lifetimes for trait items</p>



<a name="231637720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637720">(Mar 24 2021 at 13:58)</a>:</h4>
<p>I'm now pondering why that is</p>



<a name="231637736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637736">(Mar 24 2021 at 13:58)</a>:</h4>
<p>I guess that the lifetimes from the trait are in scope</p>



<a name="231637751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637751">(Mar 24 2021 at 13:58)</a>:</h4>
<p>yes</p>



<a name="231637788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637788">(Mar 24 2021 at 13:58)</a>:</h4>
<p>that doesn't seem good enough :)</p>



<a name="231637834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637834">(Mar 24 2021 at 13:59)</a>:</h4>
<p>that is, we could setup the scope again</p>



<a name="231637846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637846">(Mar 24 2021 at 13:59)</a>:</h4>
<p>but ok, that's a decent reason</p>



<a name="231637854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637854">(Mar 24 2021 at 13:59)</a>:</h4>
<p>so maybe that's the cycle then</p>



<a name="231637855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637855">(Mar 24 2021 at 13:59)</a>:</h4>
<p>I mean, I definitely thought about why we can't resolve lifetimes <em>per-owner</em></p>



<a name="231637902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637902">(Mar 24 2021 at 13:59)</a>:</h4>
<p>you don't need probably such a complex example</p>



<a name="231637913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637913">(Mar 24 2021 at 13:59)</a>:</h4>
<p>just something like</p>



<a name="231637933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637933">(Mar 24 2021 at 13:59)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">Bar</span>: <span class="nc">Foo</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="231637938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637938">(Mar 24 2021 at 13:59)</a>:</h4>
<p>will do?</p>



<a name="231637962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637962">(Mar 24 2021 at 13:59)</a>:</h4>
<p>Potentially</p>



<a name="231637969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231637969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231637969">(Mar 24 2021 at 13:59)</a>:</h4>
<p>e.g., the problem is that we need to know the "supertraits" of <code>Foo</code> sometimes</p>



<a name="231638064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638064">(Mar 24 2021 at 14:00)</a>:</h4>
<p>to resolve the <code>Bar: Foo</code></p>



<a name="231638074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638074">(Mar 24 2021 at 14:00)</a>:</h4>
<p>The example I gave was literally the first thing that stopped compiling</p>



<a name="231638098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638098">(Mar 24 2021 at 14:00)</a>:</h4>
<p>I mean presumably I have to add some some assoc types and binders and things</p>



<a name="231638137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638137">(Mar 24 2021 at 14:00)</a>:</h4>
<p>to show the necessity</p>



<a name="231638199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638199">(Mar 24 2021 at 14:00)</a>:</h4>
<p>so it <em>feels</em> like there is a different set of queries that could work here</p>



<a name="231638246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638246">(Mar 24 2021 at 14:01)</a>:</h4>
<p>that doesn't mean we can't land this PR though</p>



<a name="231638250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638250">(Mar 24 2021 at 14:01)</a>:</h4>
<p>Yeah, like I said, if we could resolve lifetimes per-owner, this would be fine</p>



<a name="231638312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638312">(Mar 24 2021 at 14:01)</a>:</h4>
<p>Anyways, let me quickly describe the split itself</p>



<a name="231638393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638393">(Mar 24 2021 at 14:01)</a>:</h4>
<p>essentially, because the work we do in <code>resolve_lifetimes_trait_definition</code> is duplicated (but also very limited), we don't want to emit any diagnostics</p>



<a name="231638500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638500">(Mar 24 2021 at 14:02)</a>:</h4>
<p>(we also can't emit i.e. lifetime unused because we can't check all possible uses)</p>



<a name="231638604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638604">(Mar 24 2021 at 14:02)</a>:</h4>
<p>And also, if we only care about the <code>trait Foo</code> part, then we don't go through any associated items</p>



<a name="231638640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638640">(Mar 24 2021 at 14:02)</a>:</h4>
<p>Does that make sense?</p>



<a name="231638898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638898">(Mar 24 2021 at 14:04)</a>:</h4>
<p>yes, I think what I would expect to see is</p>



<a name="231638911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638911">(Mar 24 2021 at 14:04)</a>:</h4>
<p>(side note, resolving lifetimes per-owner might be more possible if we move actual name resolution to ast, like <span class="user-mention silent" data-user-id="123856">Vadim Petrochenkov</span> mentioned is "on the horizon")</p>



<a name="231638970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231638970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231638970">(Mar 24 2021 at 14:04)</a>:</h4>
<p>"actual name resolution"?</p>



<a name="231639036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639036">(Mar 24 2021 at 14:04)</a>:</h4>
<p>I guess you mean <em>of lifetimes</em></p>



<a name="231639094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639094">(Mar 24 2021 at 14:05)</a>:</h4>
<p>yes</p>



<a name="231639342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639342">(Mar 24 2021 at 14:06)</a>:</h4>
<p>I'm thinking</p>



<a name="231639396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639396">(Mar 24 2021 at 14:06)</a>:</h4>
<p>I guess what I was expecting was something like "resolve_trait_header" as a building block for resolving other things</p>



<a name="231639428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639428">(Mar 24 2021 at 14:06)</a>:</h4>
<p>but really this way is ok too, it's very similar</p>



<a name="231639454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639454">(Mar 24 2021 at 14:07)</a>:</h4>
<p>I'm thinking now how to comment it</p>



<a name="231639472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639472">(Mar 24 2021 at 14:07)</a>:</h4>
<p>so that I can understand it later</p>



<a name="231639548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639548">(Mar 24 2021 at 14:07)</a>:</h4>
<p>yeah, as was commented, it is duplicated, but it would be nice if there was a clean way to make it "separate" and as "building block" like you say</p>



<a name="231639613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639613">(Mar 24 2021 at 14:08)</a>:</h4>
<p>but, it's so little work that the duplication probably doesn't matter</p>



<a name="231639799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639799">(Mar 24 2021 at 14:08)</a>:</h4>
<p>It might be worth doing a perf run, but even combined into the binder refactor, that only is a couple percent in a couple benchmarks, but overall not really any effect</p>



<a name="231639888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639888">(Mar 24 2021 at 14:09)</a>:</h4>
<p><a href="https://perf.rust-lang.org/compare.html?start=03e864fd86b8e346a2ea75235ce2b924ab453fa1&amp;end=9044cef82a24b8595a5f89c0c75a3eb867941441">https://perf.rust-lang.org/compare.html?start=03e864fd86b8e346a2ea75235ce2b924ab453fa1&amp;end=9044cef82a24b8595a5f89c0c75a3eb867941441</a> that is the binder refactor as a whole</p>



<a name="231639932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231639932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231639932">(Mar 24 2021 at 14:09)</a>:</h4>
<p>slightly worse that I remember it</p>



<a name="231640082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640082">(Mar 24 2021 at 14:10)</a>:</h4>
<p>Anyways, I have time for maybe one more question, but otherwise have to go for now</p>



<a name="231640093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640093">(Mar 24 2021 at 14:10)</a>:</h4>
<p>I am not really concerned about perf</p>



<a name="231640111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640111">(Mar 24 2021 at 14:10)</a>:</h4>
<p>But I'll be around tomorrow</p>



<a name="231640129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640129">(Mar 24 2021 at 14:10)</a>:</h4>
<p>just how to explain it</p>



<a name="231640145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640145">(Mar 24 2021 at 14:10)</a>:</h4>
<p>ok :) this was helpful, thanks!</p>



<a name="231640164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640164">(Mar 24 2021 at 14:10)</a>:</h4>
<p>Of course :)</p>



<a name="231640173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640173">(Mar 24 2021 at 14:10)</a>:</h4>
<p>I'm ready to r+ the first PR, although I might try to add some comments to capture my understanding</p>



<a name="231640219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640219">(Mar 24 2021 at 14:11)</a>:</h4>
<p>Yeah, either just push them or comment on the PR and I'll add them sometime today</p>



<a name="231640504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231640504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231640504">(Mar 24 2021 at 14:13)</a>:</h4>
<p>oh yeah, I have to rebase :/</p>



<a name="231710082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231710082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231710082">(Mar 24 2021 at 21:17)</a>:</h4>
<p>Okay <span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've rebased this PR</p>



<a name="231724230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231724230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231724230">(Mar 24 2021 at 23:13)</a>:</h4>
<p>ok!</p>



<a name="231724241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231724241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231724241">(Mar 24 2021 at 23:13)</a>:</h4>
<p>I started writing a comment but got distracted with some things</p>



<a name="231724575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231724575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231724575">(Mar 24 2021 at 23:17)</a>:</h4>
<p>It happens</p>



<a name="231796606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231796606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231796606">(Mar 25 2021 at 13:07)</a>:</h4>
<p>let me try to pick this back up again</p>



<a name="231797355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797355">(Mar 25 2021 at 13:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> I'm around now</p>



<a name="231797513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797513">(Mar 25 2021 at 13:13)</a>:</h4>
<p>I was just resetting my branch mostly in the meantime :)</p>



<a name="231797561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797561">(Mar 25 2021 at 13:13)</a>:</h4>
<p>Great</p>



<a name="231797598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797598">(Mar 25 2021 at 13:13)</a>:</h4>
<p>So, things we could do/discuss today:</p>



<a name="231797655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797655">(Mar 25 2021 at 13:14)</a>:</h4>
<p>1) Just wait for you to make comments/r+</p>



<a name="231797695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797695">(Mar 25 2021 at 13:14)</a>:</h4>
<p>2) Talk about the coinduction PR</p>



<a name="231797706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797706">(Mar 25 2021 at 13:14)</a>:</h4>
<p>3) Talk about the binder refactor PR</p>



<a name="231797748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231797748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231797748">(Mar 25 2021 at 13:14)</a>:</h4>
<p>Anything else?</p>



<a name="231798104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798104">(Mar 25 2021 at 13:17)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231797695">said</a>:</p>
<blockquote>
<p>2) Talk about the coinduction PR</p>
</blockquote>
<p>I'd like to do this</p>



<a name="231798124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798124">(Mar 25 2021 at 13:17)</a>:</h4>
<p>let me write a short-ish comment to start to see if you agree</p>



<a name="231798291"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798291" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798291">(Mar 25 2021 at 13:18)</a>:</h4>
<p>Works for me :)</p>



<a name="231798851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798851">(Mar 25 2021 at 13:22)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> pushed a commit</p>



<a name="231798890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798890">(Mar 25 2021 at 13:22)</a>:</h4>
<p>/me goes to look</p>



<a name="231798949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231798949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231798949">(Mar 25 2021 at 13:23)</a>:</h4>
<p>I'm not seeing it</p>



<a name="231799161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799161">(Mar 25 2021 at 13:24)</a>:</h4>
<p>er, pushed it now</p>



<a name="231799170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799170">(Mar 25 2021 at 13:24)</a>:</h4>
<p>I had some git problems</p>



<a name="231799235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799235">(Mar 25 2021 at 13:25)</a>:</h4>
<p>There we go</p>



<a name="231799236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799236">(Mar 25 2021 at 13:25)</a>:</h4>
<p>one sec</p>



<a name="231799420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799420">(Mar 25 2021 at 13:26)</a>:</h4>
<p>Looks good to me :)</p>



<a name="231799484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799484">(Mar 25 2021 at 13:26)</a>:</h4>
<p>great</p>



<a name="231799506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799506">(Mar 25 2021 at 13:26)</a>:</h4>
<p>then I will r+</p>



<a name="231799551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231799551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231799551">(Mar 25 2021 at 13:27)</a>:</h4>
<p><span aria-label="hearts" class="emoji emoji-2665" role="img" title="hearts">:hearts:</span></p>



<a name="231800035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800035">(Mar 25 2021 at 13:30)</a>:</h4>
<p>So, coinduction PR?</p>



<a name="231800147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800147">(Mar 25 2021 at 13:30)</a>:</h4>
<p>I will say that I looked very briefly at the previous PR and not at all at the current</p>



<a name="231800378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800378">(Mar 25 2021 at 13:32)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> if I step away for 15-20 minutes, will you be here when I get back?</p>



<a name="231800415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800415">(Mar 25 2021 at 13:32)</a>:</h4>
<p>yes</p>



<a name="231800442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800442">(Mar 25 2021 at 13:32)</a>:</h4>
<p>ok, something came up here I have to resolve :)</p>



<a name="231800449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231800449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231800449">(Mar 25 2021 at 13:32)</a>:</h4>
<p>No worries :)</p>



<a name="231816832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231816832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231816832">(Mar 25 2021 at 15:01)</a>:</h4>
<p>I just rebased this on top of the resolve refactor</p>



<a name="231849886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231849886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231849886">(Mar 25 2021 at 18:10)</a>:</h4>
<p>(bors tests have failed for <a href="https://github.com/rust-lang/rust/pull/82743">https://github.com/rust-lang/rust/pull/82743</a>)</p>



<a name="231850481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231850481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231850481">(Mar 25 2021 at 18:14)</a>:</h4>
<p>Just nll test needs blessing</p>



<a name="231850488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231850488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231850488">(Mar 25 2021 at 18:14)</a>:</h4>
<p>Already fixed</p>



<a name="231900654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231900654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231900654">(Mar 26 2021 at 01:15)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> it merged!</p>



<a name="231900789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231900789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231900789">(Mar 26 2021 at 01:17)</a>:</h4>
<p>Yes :) and the binder refactor PR is rebased</p>



<a name="231902790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231902790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231902790">(Mar 26 2021 at 01:44)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> also, be ready tomorrow because I think we have a lot to discussion (coinduction maybe, binder refactor probably, chalk closures maybe)</p>



<a name="231902985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231902985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231902985">(Mar 26 2021 at 01:47)</a>:</h4>
<p>I've been enjoying this 9am-10am hour</p>



<a name="231902994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231902994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231902994">(Mar 26 2021 at 01:47)</a>:</h4>
<p>I was thinking I might just block out that part of my day for chalk every day</p>



<a name="231903002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231903002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231903002">(Mar 26 2021 at 01:47)</a>:</h4>
<p>or every day but Tuesday, when I have a standing thing</p>



<a name="231903009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231903009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231903009">(Mar 26 2021 at 01:47)</a>:</h4>
<p>I like that idea :)</p>



<a name="231903027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231903027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231903027">(Mar 26 2021 at 01:48)</a>:</h4>
<p>Gives me a time to bug you to do or discuss things :P</p>



<a name="231958567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231958567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231958567">(Mar 26 2021 at 12:54)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> bit early but <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="231960040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231960040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231960040">(Mar 26 2021 at 13:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="231960253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231960253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231960253">(Mar 26 2021 at 13:06)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> going to be 15 minutes late-- my morning run took longer than anticipated</p>



<a name="231960275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231960275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231960275">(Mar 26 2021 at 13:06)</a>:</h4>
<p>be there very soon!</p>



<a name="231960295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231960295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231960295">(Mar 26 2021 at 13:06)</a>:</h4>
<p>Okay :)</p>



<a name="231960338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231960338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231960338">(Mar 26 2021 at 13:06)</a>:</h4>
<p>I wish I had the motivation and energy to get up early and run</p>



<a name="231961359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961359">(Mar 26 2021 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> me too</p>



<a name="231961364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961364">(Mar 26 2021 at 13:13)</a>:</h4>
<p>ok, i'm here ;)</p>



<a name="231961393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961393">(Mar 26 2021 at 13:13)</a>:</h4>
<p>I do it, but I wouldn't call myself <em>motivated</em></p>



<a name="231961575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961575">(Mar 26 2021 at 13:15)</a>:</h4>
<p>Well okay, then I wish I just made myself do it :)</p>



<a name="231961592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961592">(Mar 26 2021 at 13:15)</a>:</h4>
<p>Anyways, howdy</p>



<a name="231961606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961606">(Mar 26 2021 at 13:15)</a>:</h4>
<p>howdy!</p>



<a name="231961625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961625">(Mar 26 2021 at 13:15)</a>:</h4>
<p>shall we discuss rebinder or pick back up with coinduction</p>



<a name="231961648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961648">(Mar 26 2021 at 13:15)</a>:</h4>
<p>also, I did decide to schedule this hour most days, i'm going to add to the compiler team calendar</p>



<a name="231961739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961739">(Mar 26 2021 at 13:16)</a>:</h4>
<p>I'll let you decide :) for coinduction, I'm not sure how much I can help</p>



<a name="231961766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961766">(Mar 26 2021 at 13:16)</a>:</h4>
<p>for binder refactor, I can summarize, answer questions, help go through</p>



<a name="231961783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961783">(Mar 26 2021 at 13:16)</a>:</h4>
<p>ok, why don't we do rebinder</p>



<a name="231961801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961801">(Mar 26 2021 at 13:16)</a>:</h4>
<p>And at some point, I would like some feedback on closures in chalk</p>



<a name="231961808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961808">(Mar 26 2021 at 13:16)</a>:</h4>
<p>as long as poor <span class="user-mention" data-user-id="365822">@FireFighterDuck</span> has been waiting, you've been waiting longer :P</p>



<a name="231961839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961839">(Mar 26 2021 at 13:16)</a>:</h4>
<p>but for now, let's do the binder refactor</p>



<a name="231961848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961848">(Mar 26 2021 at 13:16)</a>:</h4>
<p>yeah I saw <a class="stream-topic" data-stream-id="144729" href="/#narrow/stream/144729-wg-traits/topic/Functions.20in.20Chalk">#wg-traits &gt; Functions in Chalk</a> too-- kind of a long topic :)</p>



<a name="231961913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961913">(Mar 26 2021 at 13:17)</a>:</h4>
<p>a lot of it is me figuring it out</p>



<a name="231961927"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961927" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961927">(Mar 26 2021 at 13:17)</a>:</h4>
<p>I will summarize when we get there</p>



<a name="231961958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231961958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231961958">(Mar 26 2021 at 13:17)</a>:</h4>
<p>Okay so <a href="https://github.com/rust-lang/rust/issues/76814">#76814</a></p>



<a name="231962037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962037">(Mar 26 2021 at 13:18)</a>:</h4>
<p>This has been rebased on master, which includes the resolve refactor</p>



<a name="231962172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962172">(Mar 26 2021 at 13:19)</a>:</h4>
<p>Let me see if I can point out a few <em>important</em> places in the PR</p>



<a name="231962214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962214">(Mar 26 2021 at 13:19)</a>:</h4>
<p>I'm not sure you need a general summary of what it's doing or the motivation</p>



<a name="231962278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962278">(Mar 26 2021 at 13:19)</a>:</h4>
<p>I remember the general idea :)</p>



<a name="231962330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962330">(Mar 26 2021 at 13:20)</a>:</h4>
<p>let me check out the code</p>



<a name="231962627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962627">(Mar 26 2021 at 13:21)</a>:</h4>
<p>Okay, so I'm just scrolling, so these aren't all in order of like "most important" just "important things I see first"</p>



<a name="231962732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962732">(Mar 26 2021 at 13:22)</a>:</h4>
<p>Which <code>BoundVarsCollector</code>/<code>ValidateBoundVars</code> in <a href="https://github.com/rust-lang/rust/blob/9d7126b6def686536f77164356e1ed23cc94de24/compiler/rustc_middle/src/ty/fold.rs#L752"><code>ty/fold</code></a></p>



<a name="231962920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962920">(Mar 26 2021 at 13:23)</a>:</h4>
<p>what about it :)</p>



<a name="231962922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962922">(Mar 26 2021 at 13:23)</a>:</h4>
<p>I'm looking at the code</p>



<a name="231962987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231962987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231962987">(Mar 26 2021 at 13:24)</a>:</h4>
<p><code>BoundVarsCollector</code> essentially just folds through a type to find bound vars. Importantly, we catch bound regions everywhere else, so that's just a <code>bug</code>. But there is one test that still has a <code>Binder::bind</code> over a type that contains a bound type (issue 644something)</p>



<a name="231963053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963053">(Mar 26 2021 at 13:24)</a>:</h4>
<p><code>ValidateBoundVars</code> is similar, but just verifys that a list of bound vars you give it matches the bound vars in the type</p>



<a name="231963087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963087">(Mar 26 2021 at 13:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/231962987">said</a>:</p>
<blockquote>
<p><code>BoundVarsCollector</code> essentially just folds through a type to find bound vars. Importantly, we catch bound regions everywhere else, so that's just a <code>bug</code>. But there is one test that still has a <code>Binder::bind</code> over a type that contains a bound type (issue 644something)</p>
</blockquote>
<p>by this you mean:</p>



<a name="231963089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963089">(Mar 26 2021 at 13:24)</a>:</h4>
<p>used in debug assertions</p>



<a name="231963127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963127">(Mar 26 2021 at 13:25)</a>:</h4>
<p>(issue 64494 test)</p>



<a name="231963160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963160">(Mar 26 2021 at 13:25)</a>:</h4>
<p>it's a bug if there are late-bond <em>lifetimes</em>...? oh, I think I see</p>



<a name="231963280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963280">(Mar 26 2021 at 13:26)</a>:</h4>
<p>There's a bug if you use <code>Binder::bind</code> on a type that has late bound lifetimes, because you should be using <code>rebind</code> or <code>bind_with_vars</code></p>



<a name="231963296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963296">(Mar 26 2021 at 13:26)</a>:</h4>
<p>because we should know that everywhere</p>



<a name="231963328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963328">(Mar 26 2021 at 13:26)</a>:</h4>
<p>(now)</p>



<a name="231963540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963540">(Mar 26 2021 at 13:27)</a>:</h4>
<p>Also, this did come up clean in the crater run, so it's not like we're missing tests that would cover the remaining <code>Binder::bind</code>s</p>



<a name="231963664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963664">(Mar 26 2021 at 13:28)</a>:</h4>
<p>Next important thing:</p>



<a name="231963735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963735">(Mar 26 2021 at 13:28)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/76814/files#diff-b12d31237d3790cfe414f072d2ac7ed12906ccbc95f01b7454c72ebab5001421R546"><code>subst_supertrait</code></a></p>



<a name="231963787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963787">(Mar 26 2021 at 13:29)</a>:</h4>
<p>I don't think there's any logic difference here actually</p>



<a name="231963862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963862">(Mar 26 2021 at 13:29)</a>:</h4>
<p>yeah</p>



<a name="231963869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963869">(Mar 26 2021 at 13:29)</a>:</h4>
<p>More so we just keep track of bound vars now and have to shift bound vars as needed</p>



<a name="231963964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231963964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231963964">(Mar 26 2021 at 13:30)</a>:</h4>
<p>I wrote a very helpful comment (for me at least) that makes things a bit more clear</p>



<a name="231964066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964066">(Mar 26 2021 at 13:30)</a>:</h4>
<p>/me continues to search</p>



<a name="231964151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964151">(Mar 26 2021 at 13:31)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/76814/files#diff-4864ab6ed9e5cec3c6d0d561211554aafbd0094842869d2a711b5451151bc534R942"><code>BoundVariableKind</code></a></p>



<a name="231964164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964164">(Mar 26 2021 at 13:31)</a>:</h4>
<p>this is a quite clean commit history</p>



<a name="231964172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964172">(Mar 26 2021 at 13:31)</a>:</h4>
<p>kind of important to the whole PR, yeah</p>



<a name="231964207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964207">(Mar 26 2021 at 13:31)</a>:</h4>
<p>That's after about 15 interactive rebases</p>



<a name="231964211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964211">(Mar 26 2021 at 13:31)</a>:</h4>
<p>Wish I was joking</p>



<a name="231964237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964237">(Mar 26 2021 at 13:31)</a>:</h4>
<p>oh I know how that goes</p>



<a name="231964321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964321">(Mar 26 2021 at 13:32)</a>:</h4>
<p>Well, I mean, there were plenty of rebases to update changes from master</p>



<a name="231964338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964338">(Mar 26 2021 at 13:32)</a>:</h4>
<p>then I split things out a few times</p>



<a name="231964386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964386">(Mar 26 2021 at 13:32)</a>:</h4>
<p>And I had fixes in later commits that I amended into earlier commits</p>



<a name="231964420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964420">(Mar 26 2021 at 13:32)</a>:</h4>
<p>And a few made more sense next to each other, so I moved them around, then squashed</p>



<a name="231964422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964422">(Mar 26 2021 at 13:32)</a>:</h4>
<p>yes, that's what I mean</p>



<a name="231964435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964435">(Mar 26 2021 at 13:32)</a>:</h4>
<p>I know how <em>that</em> goes</p>



<a name="231964453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964453">(Mar 26 2021 at 13:33)</a>:</h4>
<p>It's great</p>



<a name="231964480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964480">(Mar 26 2021 at 13:33)</a>:</h4>
<p>Git is so powerful</p>



<a name="231964489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964489">(Mar 26 2021 at 13:33)</a>:</h4>
<p>usually I just <code>git reset rust-lang/master</code> and re-add things</p>



<a name="231964549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964549">(Mar 26 2021 at 13:33)</a>:</h4>
<p>then do git rebase -i and the <code>edit</code> option to make sure things build at each step and see what I missed</p>



<a name="231964550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964550">(Mar 26 2021 at 13:33)</a>:</h4>
<p>Okay so <code>BoundVariableKind</code></p>



<a name="231964587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964587">(Mar 26 2021 at 13:33)</a>:</h4>
<p>anyway, I get the idea of this variable enum I think</p>



<a name="231964599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964599">(Mar 26 2021 at 13:33)</a>:</h4>
<p>This is essentially Chalks <code>VariableKind</code></p>



<a name="231964654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964654">(Mar 26 2021 at 13:34)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/76814/files#diff-4864ab6ed9e5cec3c6d0d561211554aafbd0094842869d2a711b5451151bc534R958"><code>Binder</code></a></p>



<a name="231964744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964744">(Mar 26 2021 at 13:34)</a>:</h4>
<p><code>Binder&lt;T&gt;(T)</code> -&gt; <code>Binder&lt;'tcx, T&gt;(T, &amp;'tcx ty::List&lt;BoundVariableKind&gt;)</code></p>



<a name="231964797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964797">(Mar 26 2021 at 13:34)</a>:</h4>
<p>Then notable changes to the <code>impl Binder</code>s:</p>



<a name="231964889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231964889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231964889">(Mar 26 2021 at 13:35)</a>:</h4>
<p><code>bind</code> now calls <code>BoundVarCollector</code>, really should only be necessary in issue 64494 test, but need to more thoroughly check</p>



<a name="231965010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965010">(Mar 26 2021 at 13:36)</a>:</h4>
<p><code>bind_with_vars</code> you have to know the vars and it checks with <code>ValidateBoundVars</code></p>



<a name="231965092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965092">(Mar 26 2021 at 13:36)</a>:</h4>
<p>/me continues scrolling</p>



<a name="231965097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965097">(Mar 26 2021 at 13:36)</a>:</h4>
<p>I guess the code I really want to read is the lifetime resolution code</p>



<a name="231965113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965113">(Mar 26 2021 at 13:36)</a>:</h4>
<p>presumably that's where the grungiest stuff happens</p>



<a name="231965186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965186">(Mar 26 2021 at 13:37)</a>:</h4>
<p>Yes, was about to mention that</p>



<a name="231965225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965225">(Mar 26 2021 at 13:37)</a>:</h4>
<p>let me see if there is anything else super important</p>



<a name="231965428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965428">(Mar 26 2021 at 13:38)</a>:</h4>
<p>no, I think <code>late/lifetimes</code> and <code>astconv/mod</code> are the next and last big things</p>



<a name="231965462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965462">(Mar 26 2021 at 13:38)</a>:</h4>
<p>so, let's start with <code>rustc_resolve::late::lifetimes</code></p>



<a name="231965543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965543">(Mar 26 2021 at 13:39)</a>:</h4>
<p>Where to start...</p>



<a name="231965565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965565">(Mar 26 2021 at 13:39)</a>:</h4>
<p>well</p>



<a name="231965576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965576">(Mar 26 2021 at 13:39)</a>:</h4>
<p>Okay, so maybe let's work backwards</p>



<a name="231965582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965582">(Mar 26 2021 at 13:39)</a>:</h4>
<p>so the tricky stuff, it seems, has to do with associated types</p>



<a name="231965592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965592">(Mar 26 2021 at 13:39)</a>:</h4>
<p>no?</p>



<a name="231965599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965599">(Mar 26 2021 at 13:39)</a>:</h4>
<p>Yes</p>



<a name="231965700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965700">(Mar 26 2021 at 13:40)</a>:</h4>
<p>But, actually, only <em>nested</em> trait refs</p>



<a name="231965842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231965842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231965842">(Mar 26 2021 at 13:41)</a>:</h4>
<p>So, there's a few different things we should discuss here</p>



<a name="231966030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966030">(Mar 26 2021 at 13:42)</a>:</h4>
<p>off the top of my head, just briefly: the "trait ref hack", nested trait ref madness/supertrait lifetime resolution, closure binders,</p>



<a name="231966062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966062">(Mar 26 2021 at 13:42)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/9d7126b6def686536f77164356e1ed23cc94de24/compiler/rustc_resolve/src/late/lifetimes.rs#L2632-L2652">https://github.com/rust-lang/rust/blob/9d7126b6def686536f77164356e1ed23cc94de24/compiler/rustc_resolve/src/late/lifetimes.rs#L2632-L2652</a></p>



<a name="231966095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966095">(Mar 26 2021 at 13:42)</a>:</h4>
<p>this is the code to manage bindings</p>



<a name="231966130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966130">(Mar 26 2021 at 13:43)</a>:</h4>
<p>yes</p>



<a name="231966287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966287">(Mar 26 2021 at 13:44)</a>:</h4>
<p>the comment is a bit inaccurate, I guess</p>



<a name="231966307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966307">(Mar 26 2021 at 13:44)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="w">        </span><span class="c1">// Resolve lifetimes found in the type `XX` from `Item = XX` bindings.</span>
</code></pre></div>



<a name="231966337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966337">(Mar 26 2021 at 13:44)</a>:</h4>
<p>I actually just was thinking: I could be clever and only query the supertrait hrtb lifetimes if the binding is <code>Constraint</code>, since that's only when it matters, but eh</p>



<a name="231966364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966364">(Mar 26 2021 at 13:44)</a>:</h4>
<p>I like it better this way</p>



<a name="231966409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966409">(Mar 26 2021 at 13:44)</a>:</h4>
<p>mmm, actually I think that comment is accurate</p>



<a name="231966412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966412">(Mar 26 2021 at 13:44)</a>:</h4>
<p>fewer ifs = better</p>



<a name="231966446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966446">(Mar 26 2021 at 13:44)</a>:</h4>
<p>Oh?</p>



<a name="231966472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966472">(Mar 26 2021 at 13:45)</a>:</h4>
<p>I expect it is..accurate but incomplete</p>



<a name="231966473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966473">(Mar 26 2021 at 13:45)</a>:</h4>
<p>That's what <code>visit_assoc_type_binding</code> does, right?</p>



<a name="231966534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966534">(Mar 26 2021 at 13:45)</a>:</h4>
<p>since it applies to <code>Item: Foo</code> too, no?</p>



<a name="231966540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966540">(Mar 26 2021 at 13:45)</a>:</h4>
<p>But yes, it is incomplete now that we also get supertrait hrtb lifetimes</p>



<a name="231966580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966580">(Mar 26 2021 at 13:45)</a>:</h4>
<p>ah yes, that too</p>



<a name="231966716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966716">(Mar 26 2021 at 13:46)</a>:</h4>
<p>Are you making review comments atm? If not, I'll add it so I don't forget to change it</p>



<a name="231966729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966729">(Mar 26 2021 at 13:46)</a>:</h4>
<p>I am not</p>



<a name="231966826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966826">(Mar 26 2021 at 13:47)</a>:</h4>
<p>I'm just reading right now</p>



<a name="231966837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966837">(Mar 26 2021 at 13:47)</a>:</h4>
<p>Okay, so for this, is it more helpful for me to talk through the various bits and pieces, or for you to read code and ask questions</p>



<a name="231966852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966852">(Mar 26 2021 at 13:47)</a>:</h4>
<p>so the <a href="https://github.com/rust-lang/rust/blob/9d7126b6def686536f77164356e1ed23cc94de24/compiler/rustc_resolve/src/late/lifetimes.rs#L2665-L2675"><code>supertrait_bounds</code></a></p>



<a name="231966881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966881">(Mar 26 2021 at 13:47)</a>:</h4>
<p>probably you can just answer questions</p>



<a name="231966910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966910">(Mar 26 2021 at 13:47)</a>:</h4>
<p>this function takes the first supertrait</p>



<a name="231966959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231966959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231966959">(Mar 26 2021 at 13:48)</a>:</h4>
<p>of course there could be more than one</p>



<a name="231967025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967025">(Mar 26 2021 at 13:48)</a>:</h4>
<p>er, wait</p>



<a name="231967054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967054">(Mar 26 2021 at 13:48)</a>:</h4>
<p>It takes the "named" trait</p>



<a name="231967142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967142">(Mar 26 2021 at 13:49)</a>:</h4>
<p>this function needs a comment for sure :)</p>



<a name="231967151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967151">(Mar 26 2021 at 13:49)</a>:</h4>
<p>Yes</p>



<a name="231967441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967441">(Mar 26 2021 at 13:50)</a>:</h4>
<p>This, along with the <code>supertraits</code> function, essentially just finds the supertrait that an associated type is defined on, while keeping track of the hrtb bound vars we find along the way</p>



<a name="231967519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967519">(Mar 26 2021 at 13:51)</a>:</h4>
<p>(There's like two other places we do something similar, but neither track bound vars; might be nice to merge the functionality)</p>



<a name="231967725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967725">(Mar 26 2021 at 13:52)</a>:</h4>
<p>I am reminded of <span class="user-mention" data-user-id="116266">@Santiago Pastorino</span>'s recent PR</p>



<a name="231967751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967751">(Mar 26 2021 at 13:53)</a>:</h4>
<p>but yes, I see this is tracking bound variables</p>



<a name="231967772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967772">(Mar 26 2021 at 13:53)</a>:</h4>
<p>it'd be nice to highlight that in a comment, it's really not obvious what the logic is here</p>



<a name="231967789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967789">(Mar 26 2021 at 13:53)</a>:</h4>
<p>(can you jot this down? I'm going to have to run soon)</p>



<a name="231967805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967805">(Mar 26 2021 at 13:53)</a>:</h4>
<p>yes</p>



<a name="231967811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967811">(Mar 26 2021 at 13:53)</a>:</h4>
<p>so far I think the main things needed are some comments and things to clarify what's going on</p>



<a name="231967861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967861">(Mar 26 2021 at 13:53)</a>:</h4>
<p>yeah, especially the more recent things</p>



<a name="231967933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231967933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231967933">(Mar 26 2021 at 13:54)</a>:</h4>
<p>where I was in the "let's get this working" mood</p>



<a name="231968257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968257">(Mar 26 2021 at 13:56)</a>:</h4>
<p>I actually might be able to reuse <code>transitive_bounds_that_define_assoc_type</code></p>



<a name="231968570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968570">(Mar 26 2021 at 13:58)</a>:</h4>
<p>ok, so, I'm going to drop now to do this thing</p>



<a name="231968580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968580">(Mar 26 2021 at 13:58)</a>:</h4>
<p>but let me add the daily 9am things to my calendar...</p>



<a name="231968620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968620">(Mar 26 2021 at 13:58)</a>:</h4>
<p>I'll do a proper review, not sure if I will get to that today though, likely not</p>



<a name="231968653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968653">(Mar 26 2021 at 13:58)</a>:</h4>
<p>but the main thing I would say now is comments, that'll also help me think through the logic and look for holes</p>



<a name="231968662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968662">(Mar 26 2021 at 13:59)</a>:</h4>
<p>very nice job!</p>



<a name="231968698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968698">(Mar 26 2021 at 13:59)</a>:</h4>
<p>I'm kind of amazed this is working :)</p>



<a name="231968763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968763">(Mar 26 2021 at 13:59)</a>:</h4>
<p>So much work</p>



<a name="231968796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968796">(Mar 26 2021 at 13:59)</a>:</h4>
<p>But I think it's probably worth it in the long run</p>



<a name="231968873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/231968873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#231968873">(Mar 26 2021 at 14:00)</a>:</h4>
<p>I'll definitely go through and add more coments and such</p>



<a name="232036377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232036377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232036377">(Mar 26 2021 at 21:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've done some nice cleanups to <code>late/lifetimes</code> and also added a bunch of comments</p>



<a name="232100170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232100170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232100170">(Mar 27 2021 at 16:10)</a>:</h4>
<p>Well that rebase didn't even last 24 hours :/</p>



<a name="232264544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232264544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232264544">(Mar 29 2021 at 13:07)</a>:</h4>
<p>wave</p>



<a name="232273121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232273121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232273121">(Mar 29 2021 at 14:04)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I'm going to try and review your comments later today; we can also talk wed if necessary</p>



<a name="232273194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232273194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232273194">(Mar 29 2021 at 14:04)</a>:</h4>
<p>Oops I forgot about this morning <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="232273203"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232273203" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232273203">(Mar 29 2021 at 14:04)</a>:</h4>
<p>sorry</p>



<a name="232586941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232586941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232586941">(Mar 31 2021 at 13:07)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="232586953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232586953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232586953">(Mar 31 2021 at 13:07)</a>:</h4>
<p>so let me start by reading your comments</p>



<a name="232586954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232586954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232586954">(Mar 31 2021 at 13:07)</a>:</h4>
<p>howdy</p>



<a name="232587137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587137">(Mar 31 2021 at 13:08)</a>:</h4>
<p>gotta find the PR first :)</p>



<a name="232587153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587153">(Mar 31 2021 at 13:08)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/76814/commits/39100e5437e13d357bd7e2b79b9bdf4c714b67f2">https://github.com/rust-lang/rust/pull/76814/commits/39100e5437e13d357bd7e2b79b9bdf4c714b67f2</a></p>



<a name="232587182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587182">(Mar 31 2021 at 13:08)</a>:</h4>
<p>that commit contains the comments and some cleanup</p>



<a name="232587226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587226">(Mar 31 2021 at 13:08)</a>:</h4>
<p>not sure if you want to read that alone or just the whole PR</p>



<a name="232587405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587405">(Mar 31 2021 at 13:10)</a>:</h4>
<p>ok</p>



<a name="232587464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232587464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232587464">(Mar 31 2021 at 13:10)</a>:</h4>
<p>I'll start with the comit I think</p>



<a name="232588261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588261">(Mar 31 2021 at 13:14)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> ok so I'm reading but in the meantime</p>



<a name="232588279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588279">(Mar 31 2021 at 13:15)</a>:</h4>
<p>in your mind, what is the "blocker" for this to land</p>



<a name="232588295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588295">(Mar 31 2021 at 13:15)</a>:</h4>
<p>(if any)</p>



<a name="232588303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588303">(Mar 31 2021 at 13:15)</a>:</h4>
<p>nothing</p>



<a name="232588305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588305">(Mar 31 2021 at 13:15)</a>:</h4>
<p>or what is your "least favorite" part</p>



<a name="232588342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588342">(Mar 31 2021 at 13:15)</a>:</h4>
<p>also</p>



<a name="232588356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588356">(Mar 31 2021 at 13:15)</a>:</h4>
<p>is there any place where we describe the "overall strategy"</p>



<a name="232588376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588376">(Mar 31 2021 at 13:15)</a>:</h4>
<p>maybe this deserves a rustc-dev-guide chapter</p>



<a name="232588395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588395">(Mar 31 2021 at 13:15)</a>:</h4>
<p>I might take a stab at outlining it in a hackmd right now</p>



<a name="232588404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588404">(Mar 31 2021 at 13:15)</a>:</h4>
<p>and see if you agree</p>



<a name="232588427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588427">(Mar 31 2021 at 13:15)</a>:</h4>
<p>my least favorite part is adding '<code>tcx</code> to <code>Binder</code>, but that's not getting changed here</p>



<a name="232588442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588442">(Mar 31 2021 at 13:15)</a>:</h4>
<p>the truth is that I trust you on the tactics, I am mostly interested in documenting the strategy</p>



<a name="232588480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588480">(Mar 31 2021 at 13:16)</a>:</h4>
<p>but other than that, this is basically what I expect it to be</p>



<a name="232588492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588492">(Mar 31 2021 at 13:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/232588427">said</a>:</p>
<blockquote>
<p>my least favorite part is adding '<code>tcx</code> to <code>Binder</code>, but that's not getting changed here</p>
</blockquote>
<p>yeah I dont' care about this right now :)</p>



<a name="232588498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588498">(Mar 31 2021 at 13:16)</a>:</h4>
<p>we need interner to fix it</p>



<a name="232588570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588570">(Mar 31 2021 at 13:16)</a>:</h4>
<p>I could definitely help outline general strategy</p>



<a name="232588593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588593">(Mar 31 2021 at 13:16)</a>:</h4>
<p>all-in-all, it's not <em>that</em> complicated</p>



<a name="232588851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588851">(Mar 31 2021 at 13:18)</a>:</h4>
<p>probably here: <a href="https://hackmd.io/5R_E6gF7T36zoD5oqYbLaQ">https://hackmd.io/5R_E6gF7T36zoD5oqYbLaQ</a></p>



<a name="232588937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588937">(Mar 31 2021 at 13:18)</a>:</h4>
<p>sure sure</p>



<a name="232588946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588946">(Mar 31 2021 at 13:19)</a>:</h4>
<p>I kind of want to write it</p>



<a name="232588961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232588961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232588961">(Mar 31 2021 at 13:19)</a>:</h4>
<p>sure</p>



<a name="232589000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232589000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232589000">(Mar 31 2021 at 13:19)</a>:</h4>
<p>That's maybe better</p>



<a name="232589006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232589006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232589006">(Mar 31 2021 at 13:19)</a>:</h4>
<p>I think I udnerstand it fine</p>



<a name="232589033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232589033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232589033">(Mar 31 2021 at 13:19)</a>:</h4>
<p>but this is a good test</p>



<a name="232589278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232589278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232589278">(Mar 31 2021 at 13:20)</a>:</h4>
<p>ok so</p>



<a name="232589767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232589767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232589767">(Mar 31 2021 at 13:23)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> I'm taking some notes at the bottom of that hackmd btw</p>



<a name="232590286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232590286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232590286">(Mar 31 2021 at 13:26)</a>:</h4>
<p>man</p>



<a name="232590305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232590305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232590305">(Mar 31 2021 at 13:27)</a>:</h4>
<p>I hate how markdown list notation can't embed code snippets</p>



<a name="232590348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232590348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232590348">(Mar 31 2021 at 13:27)</a>:</h4>
<p>not that I know what I would do differently exactly</p>



<a name="232590661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232590661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232590661">(Mar 31 2021 at 13:29)</a>:</h4>
<p>(brb)</p>



<a name="232591859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232591859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232591859">(Mar 31 2021 at 13:35)</a>:</h4>
<p>back now</p>



<a name="232591870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232591870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232591870">(Mar 31 2021 at 13:35)</a>:</h4>
<p>does it seem right so far, <span class="user-mention" data-user-id="232957">@Jack Huey</span> ?</p>



<a name="232591967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232591967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232591967">(Mar 31 2021 at 13:36)</a>:</h4>
<p>so</p>



<a name="232592058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592058">(Mar 31 2021 at 13:36)</a>:</h4>
<p>Things like</p>
<div class="codehilite"><pre><span></span><code>SubTrait&lt;Item = &amp;&#39;a XYZ&gt;
SubTrait&lt;Item: Trait&lt;&#39;a&gt;&gt;
</code></pre></div>



<a name="232592086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592086">(Mar 31 2021 at 13:37)</a>:</h4>
<p>That <code>'a</code> <em>is</em> apparent</p>



<a name="232592114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592114">(Mar 31 2021 at 13:37)</a>:</h4>
<p>yes but the problem I am trying to show is</p>



<a name="232592153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592153">(Mar 31 2021 at 13:37)</a>:</h4>
<p>its index will depend on things that are not</p>



<a name="232592183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592183">(Mar 31 2021 at 13:37)</a>:</h4>
<p>yes, that is correct</p>



<a name="232592205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592205">(Mar 31 2021 at 13:37)</a>:</h4>
<p>ah and there's the whole flattening thing to contend with</p>



<a name="232592333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592333">(Mar 31 2021 at 13:38)</a>:</h4>
<p>that's really the only "complicated" bit, imo</p>



<a name="232592402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592402">(Mar 31 2021 at 13:38)</a>:</h4>
<p>I still consider it unfortunate that <code>resolve_lifetimes </code> has to consider supertraits at all</p>



<a name="232592436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592436">(Mar 31 2021 at 13:39)</a>:</h4>
<p><strong>but I'm letting it go</strong></p>



<a name="232592442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592442">(Mar 31 2021 at 13:39)</a>:</h4>
<p>LETTING IT GO</p>



<a name="232592499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592499">(Mar 31 2021 at 13:39)</a>:</h4>
<p>The only way I could see us getting around it is to actually just desugar from ast -&gt; hir the associated type bounds</p>



<a name="232592535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592535">(Mar 31 2021 at 13:39)</a>:</h4>
<p>But I don't know if that type of desugaring happens now at all</p>



<a name="232592540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592540">(Mar 31 2021 at 13:39)</a>:</h4>
<div class="message_inline_image"><a href="https://media.giphy.com/media/xUySTxQp21GMZhX916/giphy.gif"><img src="https://media.giphy.com/media/xUySTxQp21GMZhX916/giphy.gif"></a></div>



<a name="232592755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592755">(Mar 31 2021 at 13:41)</a>:</h4>
<p>I think you should clarify that the references from super trait HRTBs only can appear in the <em>self type</em> of a projection bound</p>



<a name="232592906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592906">(Mar 31 2021 at 13:42)</a>:</h4>
<p>uh</p>



<a name="232592919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592919">(Mar 31 2021 at 13:42)</a>:</h4>
<p>how do you define self type :)</p>



<a name="232592958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592958">(Mar 31 2021 at 13:42)</a>:</h4>
<p>I think I would say "only appear in the parameters to the trait"</p>



<a name="232592967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232592967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232592967">(Mar 31 2021 at 13:42)</a>:</h4>
<p>but they can't really appear in the <code>Self</code> type specifically</p>



<a name="232593032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593032">(Mar 31 2021 at 13:42)</a>:</h4>
<p>In your example, <code>for&lt;'a, 'b&gt; &lt;&amp;'a T as SuperTrait&lt;'b&gt;&gt;::Item</code> is the self type</p>



<a name="232593092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593092">(Mar 31 2021 at 13:43)</a>:</h4>
<p>I see, ok</p>



<a name="232593113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593113">(Mar 31 2021 at 13:43)</a>:</h4>
<p>But they wouldn't be able to appear in the <code>: Trait&lt;'a&gt;</code> part</p>



<a name="232593127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593127">(Mar 31 2021 at 13:43)</a>:</h4>
<p>right</p>



<a name="232593150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593150">(Mar 31 2021 at 13:43)</a>:</h4>
<p>(or <code>= &amp;'a XYZ</code> part)</p>



<a name="232593171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593171">(Mar 31 2021 at 13:43)</a>:</h4>
<p>i.e. you can't <em>name</em> them</p>



<a name="232593193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593193">(Mar 31 2021 at 13:44)</a>:</h4>
<p>It's only relevant because of lowering</p>



<a name="232593243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593243">(Mar 31 2021 at 13:44)</a>:</h4>
<p>there's a case with more binders introduced, right?</p>



<a name="232593248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593248">(Mar 31 2021 at 13:44)</a>:</h4>
<p>so that you'd get <code>for&lt;'a, 'b, 'c&gt;</code></p>



<a name="232593283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593283">(Mar 31 2021 at 13:44)</a>:</h4>
<p>something like <code>SubTrait&lt;for&lt;'c&gt; Item: Trait&lt;'c&gt;&gt;</code>?</p>



<a name="232593322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593322">(Mar 31 2021 at 13:44)</a>:</h4>
<p>I forget exactly</p>



<a name="232593337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593337">(Mar 31 2021 at 13:44)</a>:</h4>
<p>but in the example I'm giving, I don't think the index of <code>'a</code> changes?</p>



<a name="232593347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593347">(Mar 31 2021 at 13:44)</a>:</h4>
<p>unless I'm writing it wrong</p>



<a name="232593464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593464">(Mar 31 2021 at 13:45)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/232593283">said</a>:</p>
<blockquote>
<p>something like <code>SubTrait&lt;for&lt;'c&gt; Item: Trait&lt;'c&gt;&gt;</code>?</p>
</blockquote>
<p>That's not legal :) You would have to do <code>for&lt;'c&gt; SubTrait&lt;Item: Trait&lt;'c&gt;&gt;</code></p>



<a name="232593500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593500">(Mar 31 2021 at 13:45)</a>:</h4>
<p>Yes, in your example, not indices change</p>



<a name="232593550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593550">(Mar 31 2021 at 13:45)</a>:</h4>
<p>Indices only change in nested trait refs</p>



<a name="232593651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593651">(Mar 31 2021 at 13:46)</a>:</h4>
<p>example?</p>



<a name="232593673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593673">(Mar 31 2021 at 13:46)</a>:</h4>
<p>oh goodness, let me go find it</p>



<a name="232593753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593753">(Mar 31 2021 at 13:47)</a>:</h4>
<p>it's ok</p>



<a name="232593962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593962">(Mar 31 2021 at 13:48)</a>:</h4>
<p>ok, I think I covered the key bits</p>



<a name="232593993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232593993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232593993">(Mar 31 2021 at 13:48)</a>:</h4>
<ul>
<li>The way this works in the <code>resolve_lifetimes</code> code:<br>
    * Normally we push scopes lexically<br>
    * But when we are resolving a trait ref and we encounter an associated type binding:<br>
        * We use the XXX query to get the supertraits <br>
        * This query also tracks the bound parameters that are introduced through <code>for</code> quantifiers<br>
        * We can then take those indices into account as we resolve the associated type bindiner</li>
<li>During astconv:<br>
    * We consult the various tables generates by the <code>resolve_lifetime</code> code</li>
</ul>



<a name="232594006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594006">(Mar 31 2021 at 13:48)</a>:</h4>
<p>ugh, stupid nested lists in zulip</p>



<a name="232594010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594010">(Mar 31 2021 at 13:48)</a>:</h4>
<div class="codehilite"><pre><span></span><code>trait A&lt;&#39;a&gt; {}
trait C&lt;&#39;c&gt;: for&lt;&#39;a&gt; A&lt;&#39;a&gt; {
    type As;
}
fn foo&lt;T&gt;(_: T) where T: for&lt;&#39;c&gt; C&lt;&#39;c, As: A&lt;&#39;c&gt;&gt; {}
</code></pre></div>



<a name="232594058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594058">(Mar 31 2021 at 13:49)</a>:</h4>
<p>Err, nope, not that</p>



<a name="232594094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594094">(Mar 31 2021 at 13:49)</a>:</h4>
<div class="codehilite"><pre><span></span><code>trait I&lt;&#39;a, &#39;b, &#39;c&gt; {
    type As;
}
trait H&lt;&#39;d, &#39;e&gt;: for&lt;&#39;f&gt; I&lt;&#39;d, &#39;f, &#39;e&gt; + &#39;d {}
fn foo2&lt;T&gt;()
where
    T: for&lt;&#39;g&gt; H&lt;&#39;g, &#39;g, As: for&lt;&#39;h&gt; H&lt;&#39;h, &#39;g&gt; + &#39;g&gt;,
{
}
</code></pre></div>



<a name="232594108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594108">(Mar 31 2021 at 13:49)</a>:</h4>
<p>I was going to say</p>



<a name="232594117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594117">(Mar 31 2021 at 13:49)</a>:</h4>
<p>that didn't seem right</p>



<a name="232594118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594118">(Mar 31 2021 at 13:49)</a>:</h4>
<p>ok</p>



<a name="232594246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594246">(Mar 31 2021 at 13:50)</a>:</h4>
<p>The index of <code>'h</code> isn't <code>1</code> like you might expect from the bound vars in the syntax, but instead <code>2</code> because <code>'f</code> gets added</p>



<a name="232594281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594281">(Mar 31 2021 at 13:50)</a>:</h4>
<p>ok, I think I can make a simpler variant for my explanation</p>



<a name="232594394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594394">(Mar 31 2021 at 13:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/binder.20refactor/near/232593962">said</a>:</p>
<blockquote>
<p>ok, I think I covered the key bits</p>
</blockquote>
<p>looks right to me</p>



<a name="232594453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594453">(Mar 31 2021 at 13:51)</a>:</h4>
<p>Yeah, that came straight from tests. You really only need only lifetime</p>



<a name="232594835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594835">(Mar 31 2021 at 13:53)</a>:</h4>
<p>yeah so I think there are two surprising things</p>



<a name="232594856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594856">(Mar 31 2021 at 13:53)</a>:</h4>
<p>the first is binder flattening <em>period</em></p>



<a name="232594877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594877">(Mar 31 2021 at 13:53)</a>:</h4>
<p>the second is that binder flattening may introduce variables from super traits</p>



<a name="232594941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594941">(Mar 31 2021 at 13:54)</a>:</h4>
<p>i.e., <code>for&lt;'a&gt; Foo&lt;Bar: for&lt;'c&gt; ..&gt;</code></p>



<a name="232594961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594961">(Mar 31 2021 at 13:54)</a>:</h4>
<p>doesn't result in 2 debruijn indices but one</p>



<a name="232594970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232594970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232594970">(Mar 31 2021 at 13:54)</a>:</h4>
<p>that itself is surprising to me :)</p>



<a name="232595018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595018">(Mar 31 2021 at 13:54)</a>:</h4>
<p>so, this it basically what the associated type bounds RFC says it should do</p>



<a name="232595036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595036">(Mar 31 2021 at 13:54)</a>:</h4>
<p>/me gets link</p>



<a name="232595038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595038">(Mar 31 2021 at 13:54)</a>:</h4>
<p>sure</p>



<a name="232595068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595068">(Mar 31 2021 at 13:54)</a>:</h4>
<p>but that's because the RFC is surprising</p>



<a name="232595085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595085">(Mar 31 2021 at 13:54)</a>:</h4>
<p>(to me) :)</p>



<a name="232595096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595096">(Mar 31 2021 at 13:54)</a>:</h4>
<p><a href="https://rust-lang.github.io/rfcs/2289-associated-type-bounds.html">https://rust-lang.github.io/rfcs/2289-associated-type-bounds.html</a></p>



<a name="232595119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595119">(Mar 31 2021 at 13:55)</a>:</h4>
<p>the natural thing to me would be to desugar to nested foralls</p>



<a name="232595200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595200">(Mar 31 2021 at 13:55)</a>:</h4>
<p>we're just kind of making our lives  more complicated</p>



<a name="232595221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595221">(Mar 31 2021 at 13:55)</a>:</h4>
<p>because we don't have those</p>



<a name="232595233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595233">(Mar 31 2021 at 13:55)</a>:</h4>
<p>Well, actually, I'm trying to remember. Maybe the RFC didn't say anything about the bound vars</p>



<a name="232595387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595387">(Mar 31 2021 at 13:56)</a>:</h4>
<p>we already had this discrepancy</p>



<a name="232595409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595409">(Mar 31 2021 at 13:56)</a>:</h4>
<p>it is what gave rise to <code>trait_ref_hack</code></p>



<a name="232595437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595437">(Mar 31 2021 at 13:56)</a>:</h4>
<p><em>really</em> we ought to have two levels of binder in the HIR</p>



<a name="232595447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595447">(Mar 31 2021 at 13:56)</a>:</h4>
<p>or, even, I think we do</p>



<a name="232595468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595468">(Mar 31 2021 at 13:56)</a>:</h4>
<p>But it did say that <code>T: Foo&lt;Bar: Baz&gt;</code> does desugar to <code>&lt;T as Foo&gt;::Bar: Baz</code></p>



<a name="232595503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595503">(Mar 31 2021 at 13:57)</a>:</h4>
<p>That's a really good point</p>



<a name="232595546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595546">(Mar 31 2021 at 13:57)</a>:</h4>
<p>I didn't realize that until just now :)</p>



<a name="232595617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595617">(Mar 31 2021 at 13:57)</a>:</h4>
<p>Actually, in this PR, it's even apparent that we have to treat <em>both</em> sets of bound vars for <code>trait_ref_hack</code> as in scope</p>



<a name="232595681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232595681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232595681">(Mar 31 2021 at 13:58)</a>:</h4>
<p>so yeah, I guess that's also a form of "flattening"</p>



<a name="232596073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232596073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232596073">(Mar 31 2021 at 14:00)</a>:</h4>
<p>ok, gotta go, the hackmd is almost done in my view</p>



<a name="232596078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232596078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232596078">(Mar 31 2021 at 14:00)</a>:</h4>
<p>if that is accurate, I'm ready to r+</p>



<a name="232596137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232596137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232596137">(Mar 31 2021 at 14:00)</a>:</h4>
<p>Ooh nice</p>



<a name="232596220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232596220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232596220">(Mar 31 2021 at 14:01)</a>:</h4>
<p>What we wrote is accurate</p>



<a name="232596240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232596240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232596240">(Mar 31 2021 at 14:01)</a>:</h4>
<p>I will rebase and then let you r+</p>



<a name="232604141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232604141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232604141">(Mar 31 2021 at 14:46)</a>:</h4>
<p>Okay <span class="user-mention" data-user-id="116009">@nikomatsakis</span> it's rebased for whatever you want to do with it :)</p>



<a name="232661460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232661460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232661460">(Mar 31 2021 at 20:39)</a>:</h4>
<p>It's merged <span aria-label="hearts" class="emoji emoji-2665" role="img" title="hearts">:hearts:</span></p>



<a name="232661558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232661558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232661558">(Mar 31 2021 at 20:40)</a>:</h4>
<p>how many months of work was that again?</p>



<a name="232661614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232661614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232661614">(Mar 31 2021 at 20:40)</a>:</h4>
<p>more than 6</p>



<a name="232661820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232661820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232661820">(Mar 31 2021 at 20:42)</a>:</h4>
<p>insane. great work!</p>



<a name="232661932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232661932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232661932">(Mar 31 2021 at 20:43)</a>:</h4>
<p>now time to go cleanup/delete the like 2 dozen branches from rebases/splitting off</p>



<a name="232830820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232830820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232830820">(Apr 01 2021 at 21:57)</a>:</h4>
<p>Am I missing something? <a href="https://github.com/rust-lang/rust/issues/83737#issuecomment-812164105">https://github.com/rust-lang/rust/issues/83737#issuecomment-812164105</a></p>



<a name="232831256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831256">(Apr 01 2021 at 22:01)</a>:</h4>
<p>It's not the exact same thing twice I think</p>



<a name="232831358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831358">(Apr 01 2021 at 22:02)</a>:</h4>
<p><code>ReErased</code> in one, <code>ReLateBound(DebruijnIndex(1), BoundRegion { var: 6, kind: BrNamed('t4) })</code> in the other</p>



<a name="232831407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831407">(Apr 01 2021 at 22:02)</a>:</h4>
<p>Where?</p>



<a name="232831412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831412">(Apr 01 2021 at 22:02)</a>:</h4>
<p>In the last comment?</p>



<a name="232831427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831427">(Apr 01 2021 at 22:02)</a>:</h4>
<p>Looking at the <code>Zverbose</code> output in <a href="https://github.com/rust-lang/rust/issues/83737#issuecomment-812071616">https://github.com/rust-lang/rust/issues/83737#issuecomment-812071616</a></p>



<a name="232831443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831443">(Apr 01 2021 at 22:02)</a>:</h4>
<p>that's out of date</p>



<a name="232831466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831466">(Apr 01 2021 at 22:03)</a>:</h4>
<p>not what is actually being compared</p>



<a name="232831603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831603">(Apr 01 2021 at 22:04)</a>:</h4>
<p>(<code>decl.ty</code> and <code>witness</code> were being printed, now it's actually <code>decl_ty</code> and <code>allowed</code>)</p>



<a name="232831606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831606">(Apr 01 2021 at 22:04)</a>:</h4>
<p>ah right. Yeah in the last comment it's the same, my bad</p>



<a name="232831647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831647">(Apr 01 2021 at 22:05)</a>:</h4>
<p>Okay so...why is <code>allowed.contains(&amp;decl_ty)</code> returning false</p>



<a name="232831729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831729">(Apr 01 2021 at 22:05)</a>:</h4>
<p>There is also <a href="https://github.com/rust-lang/rust/issues/83753">https://github.com/rust-lang/rust/issues/83753</a> with a MCVE, maybe they are the same?</p>



<a name="232831849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831849">(Apr 01 2021 at 22:06)</a>:</h4>
<p>Nope that's different I think</p>



<a name="232831940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831940">(Apr 01 2021 at 22:07)</a>:</h4>
<p>Pretty sure that one is easy: just trying to get bound vars for a trait that doesn't exist</p>



<a name="232831951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831951">(Apr 01 2021 at 22:08)</a>:</h4>
<p>Because the associated item is on a struct</p>



<a name="232831991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232831991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232831991">(Apr 01 2021 at 22:08)</a>:</h4>
<p>Too bad, it's going to be challenging to "remotely" debug fuschia codebase without a MCVE :/</p>



<a name="232832128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832128">(Apr 01 2021 at 22:09)</a>:</h4>
<p>Right</p>



<a name="232832198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832198">(Apr 01 2021 at 22:10)</a>:</h4>
<p>And I feel really bad about asking <span class="user-mention silent" data-user-id="296355">Rich Kadel</span> to test my patches</p>



<a name="232832278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832278">(Apr 01 2021 at 22:11)</a>:</h4>
<p>I mean, the issue is clear (at least, the final bit of it is): the type in the witness list isn't exactly the same as the type we're checking</p>



<a name="232832303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832303">(Apr 01 2021 at 22:11)</a>:</h4>
<p>Even though we erase all regions</p>



<a name="232832327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832327">(Apr 01 2021 at 22:11)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I imagine you're about to get off, but any thoughts?</p>



<a name="232832607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832607">(Apr 01 2021 at 22:14)</a>:</h4>
<p>I mean, <em>maybe</em> the same type is getting interned differently?</p>



<a name="232832614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832614">(Apr 01 2021 at 22:14)</a>:</h4>
<p>that would be really weird</p>



<a name="232832800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232832800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232832800">(Apr 01 2021 at 22:16)</a>:</h4>
<p>(that doesn't even make sense though)</p>



<a name="232833571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232833571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marmeladema <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232833571">(Apr 01 2021 at 22:24)</a>:</h4>
<p>Someone just posted what appears to be a similar issue with <code>tide</code></p>



<a name="232833636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232833636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232833636">(Apr 01 2021 at 22:25)</a>:</h4>
<p>yep that's the same issue</p>



<a name="232833878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232833878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232833878">(Apr 01 2021 at 22:27)</a>:</h4>
<p>I still don't understand what's going on</p>



<a name="232901060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901060">(Apr 02 2021 at 13:53)</a>:</h4>
<p><span class="user-mention" data-user-id="232957">@Jack Huey</span> They're definitely interning differently... I'm seeing:</p>
<div class="codehilite"><pre><span></span><code>allowed[4] = 0x000000011a8bcfe0 (&amp;mut dyn std::future::Future&lt;Output = ()&gt; + std::marker::Unpin)
decl_ty = 0x000000011a8b1588 (&amp;mut dyn std::future::Future&lt;Output = ()&gt; + std::marker::Unpin)
</code></pre></div>



<a name="232901415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901415">(Apr 02 2021 at 13:56)</a>:</h4>
<p>I'm going to be honest, this was a rabbit hole I did <em>not</em> expect to be going down</p>



<a name="232901504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901504">(Apr 02 2021 at 13:58)</a>:</h4>
<p>It's a bit weird though? I would expect that the <code>PartialEq</code> impl would forward to the <code>TyS</code> impl?</p>



<a name="232901579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901579">(Apr 02 2021 at 13:58)</a>:</h4>
<p>Oh it is, but <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html#319-324">this</a></p>



<a name="232901609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901609">(Apr 02 2021 at 13:58)</a>:</h4>
<p><span class="user-mention" data-user-id="249694">@eggyal</span> thank you btw for looking into this. I'm going to be short on time today</p>



<a name="232901774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901774">(Apr 02 2021 at 14:00)</a>:</h4>
<p>It's probably worth debug printing out the flags and <code>outer_exclusive_binder</code></p>



<a name="232901818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232901818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232901818">(Apr 02 2021 at 14:00)</a>:</h4>
<p><em>hopefully</em> it's not the actually allocation/interning that's different</p>



<a name="232904472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232904472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232904472">(Apr 02 2021 at 14:24)</a>:</h4>
<p>They both have <code>flags: HAS_RE_ERASED</code> and <code>outer_exclusive_binder: DebruijnIndex(0)</code></p>



<a name="232904992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232904992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232904992">(Apr 02 2021 at 14:29)</a>:</h4>
<p>Welp</p>



<a name="232907695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232907695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232907695">(Apr 02 2021 at 14:53)</a>:</h4>
<p>Oh, hang on... <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html#329">https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html#329</a> ?</p>



<a name="232909272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232909272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232909272">(Apr 02 2021 at 15:05)</a>:</h4>
<p>I don't think hashing here matters; <code>.contains</code> uses <code>PartialEq</code></p>



<a name="232909368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232909368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232909368">(Apr 02 2021 at 15:06)</a>:</h4>
<p>But <code>PartialEq</code> uses <code>ptr::eq(self, other)</code></p>



<a name="232909376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232909376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232909376">(Apr 02 2021 at 15:06)</a>:</h4>
<p>so same issue</p>



<a name="232909780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232909780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232909780">(Apr 02 2021 at 15:09)</a>:</h4>
<p>No, but when interning, the hash determines whether they are the same object or not..?</p>



<a name="232910701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232910701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232910701">(Apr 02 2021 at 15:16)</a>:</h4>
<p>Well, I think this is just saying that the Hash of <code>Ty&lt;'tcx&gt;</code> (or <code>&amp;'tcx TyS&lt;'tcx&gt;</code>) is just the hash of the pointer?</p>



<a name="232911054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232911054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232911054">(Apr 02 2021 at 15:18)</a>:</h4>
<p>We should only be getting <code>&amp;'tcx TyS&lt;'tcx&gt;</code> i.e. we should only be getting those <em>from</em> <code>intern_ty</code></p>



<a name="232911577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232911577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232911577">(Apr 02 2021 at 15:22)</a>:</h4>
<p>Ah, okay.  Will take a closer look a bit later.  Just out walking the dogs rn <span aria-label="puppy" class="emoji emoji-1f436" role="img" title="puppy">:puppy:</span></p>



<a name="232911966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232911966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232911966">(Apr 02 2021 at 15:26)</a>:</h4>
<p>No worries :)</p>



<a name="232951589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951589">(Apr 02 2021 at 21:03)</a>:</h4>
<p>okay so</p>



<a name="232951633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951633">(Apr 02 2021 at 21:03)</a>:</h4>
<p>With the tide MCVE</p>



<a name="232951686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951686">(Apr 02 2021 at 21:04)</a>:</h4>
<p>We have a <code>decl_ty</code> of</p>
<div class="codehilite"><pre><span></span><code>decl_ty.kind() = Adt(
    std::boxed::Box,
    [
        (dyn std::future::Future&lt;Output = ()&gt; + std::marker::Unpin + ReErased),
        std::alloc::Global,
    ],
)
</code></pre></div>



<a name="232951732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951732">(Apr 02 2021 at 21:04)</a>:</h4>
<p>And</p>
<div class="codehilite"><pre><span></span><code>a.kind() = Adt(
    std::boxed::Box,
    [
        (dyn std::future::Future&lt;Output = ()&gt; + std::marker::Unpin + ReErased),
        std::alloc::Global,
    ],
)
</code></pre></div>
<p>in the list</p>



<a name="232951751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951751">(Apr 02 2021 at 21:04)</a>:</h4>
<p>Looks the same right? (This is <code>-Zverbose</code>)</p>



<a name="232951820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951820">(Apr 02 2021 at 21:05)</a>:</h4>
<p>Well, the ty in the list has </p>
<div class="codehilite"><pre><span></span><code>Binder(
            Trait(
                std::future::Future,
            ),
            [],
        )
</code></pre></div>



<a name="232951884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232951884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232951884">(Apr 02 2021 at 21:05)</a>:</h4>
<p>Whereas the <code>decl_ty</code> has</p>
<div class="codehilite"><pre><span></span><code>Binder(
            Trait(
                std::future::Future,
            ),
            [
                Region(
                    BrAnon(0),
                ),
            ],
        )
</code></pre></div>



<a name="232952071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232952071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232952071">(Apr 02 2021 at 21:07)</a>:</h4>
<p>So first off, why the heck is this <em>not</em> getting printed</p>



<a name="232952085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232952085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232952085">(Apr 02 2021 at 21:07)</a>:</h4>
<p>second, the heck</p>



<a name="232952687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232952687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232952687">(Apr 02 2021 at 21:12)</a>:</h4>
<p>Okay, so the bound vars aren't getting printed because pretty printing searches through the type to find bound vars</p>



<a name="232952700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232952700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232952700">(Apr 02 2021 at 21:12)</a>:</h4>
<p>which there are none</p>



<a name="232959012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232959012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232959012">(Apr 02 2021 at 22:25)</a>:</h4>
<p>Alright so when when we "see" the generator to generate witnesses, there is</p>
<div class="codehilite"><pre><span></span><code>std::boxed::Box&lt;(dyn for&lt;&#39;r&gt; std::future::Future&lt;for&lt;&#39;s&gt; Output = ()&gt; + std::marker::Unpin + ReStatic)&gt;
</code></pre></div>
<p>and</p>
<div class="codehilite"><pre><span></span><code>std::boxed::Box&lt;(dyn for&lt;&#39;r&gt; std::future::Future&lt;for&lt;&#39;s&gt; Output = ()&gt; + std::marker::Unpin + &#39;_#6r)&gt;
</code></pre></div>



<a name="232959063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232959063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232959063">(Apr 02 2021 at 22:26)</a>:</h4>
<p>But the type in the witness ends up </p>
<div class="codehilite"><pre><span></span><code>std::boxed::Box&lt;(dyn std::future::Future&lt;Output = ()&gt; + std::marker::Unpin + ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed(&#39;t0) }))&gt;
</code></pre></div>



<a name="232959084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232959084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232959084">(Apr 02 2021 at 22:26)</a>:</h4>
<p>i.e. we're losing the binders</p>



<a name="232960258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232960258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232960258">(Apr 02 2021 at 22:41)</a>:</h4>
<p>Sidenote, I don't know if there's a better way to do this, but I really wish there was a flag to tell <code>compiletest</code> to <em>not</em> truncate the stderr</p>



<a name="232960269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232960269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232960269">(Apr 02 2021 at 22:41)</a>:</h4>
<p>Sometimes I just want to see everything</p>



<a name="232960394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232960394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232960394">(Apr 02 2021 at 22:43)</a>:</h4>
<p><code>YES_I_KNOW_ITS_ALOT_JUST_PRINT_EVERYTHING=yes</code></p>



<a name="232961194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232961194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232961194">(Apr 02 2021 at 22:54)</a>:</h4>
<p>Welp</p>



<a name="232961198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232961198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232961198">(Apr 02 2021 at 22:54)</a>:</h4>
<p><code>anonymize_late_bound_regions</code></p>



<a name="232961216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232961216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232961216">(Apr 02 2021 at 22:55)</a>:</h4>
<p>Ignores existing bound vars</p>



<a name="232962156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232962156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232962156">(Apr 02 2021 at 23:06)</a>:</h4>
<p>Sorry, am back looking at this again now too</p>



<a name="232962175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232962175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232962175">(Apr 02 2021 at 23:06)</a>:</h4>
<p>That's okay, I have a fix</p>



<a name="232962255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232962255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232962255">(Apr 02 2021 at 23:07)</a>:</h4>
<p>:)  Ah, great.</p>



<a name="232962263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232962263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232962263">(Apr 02 2021 at 23:07)</a>:</h4>
<p>At least I think it's a fix</p>



<a name="232962267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232962267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232962267">(Apr 02 2021 at 23:07)</a>:</h4>
<p>Just about to build/test</p>



<a name="232963579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232963579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232963579">(Apr 02 2021 at 23:24)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0282]: type annotations needed
    --&gt; library/alloc/src/string.rs:1226:31
     |
1226 |     pub fn remove_matches&lt;&#39;a, P&gt;(&amp;&#39;a mut self, pat: P)
     |                               ^ cannot infer type for type parameter `P`

error: aborting due to previous error
</code></pre></div>



<a name="232963592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232963592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232963592">(Apr 02 2021 at 23:24)</a>:</h4>
<p>Okay so maybe this isn't correct</p>



<a name="232963619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232963619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232963619">(Apr 02 2021 at 23:25)</a>:</h4>
<p>maybe I made a mistake in my implementation</p>



<a name="232963668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232963668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232963668">(Apr 02 2021 at 23:25)</a>:</h4>
<p>I keep coming to the <code>skip_binder()</code> in <code>replace_late_bound_regions</code>... but I readily confess I'm not as close to this as you are, Jack...</p>



<a name="232963750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232963750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232963750">(Apr 02 2021 at 23:27)</a>:</h4>
<p>What about it?</p>



<a name="232964117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eggyal <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964117">(Apr 02 2021 at 23:32)</a>:</h4>
<p>No, sorry, ignore that.  I'm getting myself in a muddle.</p>



<a name="232964127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964127">(Apr 02 2021 at 23:32)</a>:</h4>
<p>No worries</p>



<a name="232964140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964140">(Apr 02 2021 at 23:32)</a>:</h4>
<p>I need to take a break and think</p>



<a name="232964209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964209">(Apr 02 2021 at 23:33)</a>:</h4>
<p>Here's where I'm at: what exactly is the expected behavior for <code>anonymize_late_bound_regions</code></p>



<a name="232964356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964356">(Apr 02 2021 at 23:35)</a>:</h4>
<p>First, does it "anonymize" the binders? Or just the lifetimes within</p>



<a name="232964357"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/232964357" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#232964357">(Apr 02 2021 at 23:35)</a>:</h4>
<p>Next, does it anonymize the same lifetime seen multiple times to the same anonymous lifetime or multiple?</p>



<a name="233016254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016254">(Apr 03 2021 at 16:20)</a>:</h4>
<p>Okay, so back looking at this</p>



<a name="233016289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016289">(Apr 03 2021 at 16:21)</a>:</h4>
<p>I think this fundamentally is caused by a subtle problem:</p>



<a name="233016301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016301">(Apr 03 2021 at 16:21)</a>:</h4>
<p>There's a couple different ways we can "erase regions"</p>



<a name="233016434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016434">(Apr 03 2021 at 16:24)</a>:</h4>
<p>The default <code>erase_regions</code> visits regions that <em>aren't</em> late bound and replaces them with <code>ReErased</code> <em>but also</em> recursively calls <code>anonymize_late_bound_regions</code> when we see a <code>Binder</code></p>



<a name="233016546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016546">(Apr 03 2021 at 16:26)</a>:</h4>
<p>But there's also <code>erase_late_bound_regions</code>, which replaces late-bound regions with <code>ReErased</code>, but <em>doesn't</em> "recurse" in the sense that it "anonymizes" Binders</p>



<a name="233016575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016575">(Apr 03 2021 at 16:27)</a>:</h4>
<p>This is sort of tricky because of the questions I raised before about how <code>anonymize_late_bound_regions</code> should work</p>



<a name="233016581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016581">(Apr 03 2021 at 16:27)</a>:</h4>
<p>And a fundamental question: should <code>for&lt;'a&gt; fn() -&gt; ()</code> equal <code>fn() -&gt; ()</code></p>



<a name="233016648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233016648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233016648">(Apr 03 2021 at 16:29)</a>:</h4>
<p>But you can imagine that's somewhat extended to <code>for&lt;'a&gt; fn(&amp;'a ())</code> and <code>for&lt;'b&gt; fn(&amp;'b ())</code></p>



<a name="233022033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022033">(Apr 03 2021 at 18:07)</a>:</h4>
<p>Okay well this was a rabbit I didn't need to fall down</p>



<a name="233022074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022074">(Apr 03 2021 at 18:08)</a>:</h4>
<p>(I think this might still be relevant at some point though)</p>



<a name="233022081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022081">(Apr 03 2021 at 18:08)</a>:</h4>
<p>Let's back up</p>



<a name="233022086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022086">(Apr 03 2021 at 18:08)</a>:</h4>
<p><code>F: Fn(&amp;()) -&gt; Box&lt;dyn Future&lt;Output = ()&gt; + Unpin&gt;</code></p>



<a name="233022123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022123">(Apr 03 2021 at 18:08)</a>:</h4>
<p><code>std::boxed::Box&lt;(dyn for&lt;'r&gt; std::future::Future&lt;for&lt;'s&gt; Output = ()&gt; + std::marker::Unpin + ReStatic)&gt;</code></p>



<a name="233022126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022126">(Apr 03 2021 at 18:09)</a>:</h4>
<p>Where did that <code>'r</code> and <code>'s</code> come from?</p>



<a name="233022130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022130">(Apr 03 2021 at 18:09)</a>:</h4>
<p>That isn't right</p>



<a name="233022269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022269">(Apr 03 2021 at 18:11)</a>:</h4>
<p>I made a mistake with my "concatenate bound vars in nested trait refs" implementation</p>



<a name="233022339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022339">(Apr 03 2021 at 18:12)</a>:</h4>
<p>When we get to the <code>for&lt;?&gt; Future</code> trait ref</p>



<a name="233022361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022361">(Apr 03 2021 at 18:13)</a>:</h4>
<p>We try to see if we're in a nested trait ref, so we backup and find the <code>for&lt;'_&gt; Fn(&amp;())</code> trait ref</p>



<a name="233022368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022368">(Apr 03 2021 at 18:13)</a>:</h4>
<p>which isn't right</p>



<a name="233022518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022518">(Apr 03 2021 at 18:16)</a>:</h4>
<p>Okay, so breaking early when we see a <code>Elision</code> or <code>ObjectLifetimeDefault</code> scope fixes it</p>



<a name="233022534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022534">(Apr 03 2021 at 18:16)</a>:</h4>
<p>which was an...easy fix</p>



<a name="233022543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022543">(Apr 03 2021 at 18:16)</a>:</h4>
<p>Just have to think a little bit</p>



<a name="233022549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022549">(Apr 03 2021 at 18:16)</a>:</h4>
<p>and run all tests</p>



<a name="233022562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022562">(Apr 03 2021 at 18:16)</a>:</h4>
<p>welp, nope</p>



<a name="233022588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233022588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233022588">(Apr 03 2021 at 18:17)</a>:</h4>
<p>okay, be back in a bit</p>



<a name="233023901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233023901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233023901">(Apr 03 2021 at 18:39)</a>:</h4>
<p>back</p>



<a name="233042116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233042116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233042116">(Apr 03 2021 at 23:56)</a>:</h4>
<p>I was just reading <a href="https://rustc-dev-guide.rust-lang.org/early-late-bound.html#late-bound-parameters">https://rustc-dev-guide.rust-lang.org/early-late-bound.html#late-bound-parameters</a> and noticed that it says</p>
<blockquote>
<p>The Binder doesn't know how many variables there are at that binding level. This can only be determined by walking the type itself and collecting them. So a type like for&lt;'a, 'b&gt; ('a, 'b) would be for (^0.a, ^0.b). Here, we just write for because we don't know the names of the things bound within.<br>
[...]<br>
This setup of not knowing the full set of variables at a binding level has some advantages and some disadvantages. The disadvantage is that you must walk the type to find out what is bound at the given level and so forth. The advantage is primarily that, when constructing types from Rust syntax, if we encounter anonymous regions like in fn(&amp;u32), we just create a fresh index and don't have to update the binder.</p>
</blockquote>
<p>Is this still true after the binder refactor, or does it need to be updated?</p>



<a name="233046099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233046099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233046099">(Apr 04 2021 at 01:16)</a>:</h4>
<p>Needs to be updated :)</p>



<a name="233047194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233047194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233047194">(Apr 04 2021 at 01:38)</a>:</h4>
<p>Thanks! Opened an issue: <a href="https://github.com/rust-lang/rustc-dev-guide/issues/1105">rustc-dev-guide#1105</a>.</p>



<a name="233169174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233169174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233169174">(Apr 05 2021 at 13:05)</a>:</h4>
<p>(marking this topic as read; you'll have to catch me up)</p>



<a name="233169276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/binder%20refactor/near/233169276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/binder.20refactor.html#233169276">(Apr 05 2021 at 13:06)</a>:</h4>
<p>Works for me</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>